[SERVER-61016] Swallow connection reset-related errors received during ASIOSession creation on outbound connection. Created: 26/Oct/21  Updated: 29/Oct/23  Resolved: 11/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.2.0
Fix Version/s: 5.2.0, 5.0.7

Type: Bug Priority: Major - P3
Reporter: Blake Oler Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-61396 Fix data race in ConnectionThread and... Closed
Problem/Incident
causes SERVER-61490 transport_layer_test: asio connect race Closed
Related
related to SERVER-57466 Swallow connection reset-related erro... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0, v4.4
Sprint: Service Arch 2021-11-01, Service Arch 2021-11-15, Service Arch 2021-11-22
Participants:
Linked BF Score: 151
Story Points: 3

 Description   

Changes were recently made so that asio system errors were thrown directly from the ASIOSession constructor. In making that change, some callers to this constructor aren't prepared to catch that exception type. Example transport_layer_asio.cpp:592.

Identified constructor calls:



 Comments   
Comment by Githook User [ 18/Mar/22 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-61016 SessionASIO ctor setsockopt exception handling

(cherry picked from commit fefeb243ee61099626d00e29fee51acc1da44a4b)
Branch: v5.0
https://github.com/mongodb/mongo/commit/cffe45e0f03d08e7701f8280f13dd1545702f92e

Comment by Githook User [ 15/Nov/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-61016 temporarily disable flaky test
Branch: master
https://github.com/mongodb/mongo/commit/8075d894ec07cbff515d7887927c15eb0dc6b2ab

Comment by Githook User [ 11/Nov/21 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-61016 SessionASIO ctor setsockopt exception handling
Branch: master
https://github.com/mongodb/mongo/commit/fefeb243ee61099626d00e29fee51acc1da44a4b

Comment by Billy Donahue [ 11/Nov/21 ]

FTR, it seems to be only on MacOS that the ASIO socket::set_option fails on peer-reset connections. Linux and Windows allow the option to be set without error. The test for this behavior resets the connection at the connection's remote end, waits a full 1.0 seconds, then calls set_option on the local end and observes any thrown exceptions.

Comment by Billy Donahue [ 04/Nov/21 ]

Suggested plan:

  1. Identify all calls to the constructor of ASIOSession to see which ones aren't tolerant of asio::system_error
  2. Fix all said calls.
  3. Create tests to verify this behavior.
Generated at Thu Feb 08 05:51:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.