[SERVER-61804] Fix race in ConfirmSocketSetOptionOnResetConnections in transport_layer_asio_test.cpp Created: 30/Nov/21  Updated: 29/Oct/23  Resolved: 13/Dec/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0-rc0, 5.0.7, 5.2.2

Type: Bug Priority: Major - P3
Reporter: Tyler Seip (Inactive) Assignee: Backlog - Service Architecture
Resolution: Fixed Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.2, v5.0
Sprint: Service Arch 2021-12-13, Service Arch 2022-1-10
Participants:
Linked BF Score: 34

 Description   

ConfirmSocketSetOptionOnResetConnections may have a race in it wherein an ASIO socket's connect() call may not return by the time the ASIO acceptor on the server end returns from accept(). In ConfirmSocketSetOptionOnResetConnections, this allows the server side to close the connection before connect() finishes, which causes connect() to fail and throw, failing the test. Add a synchronization mechanism to ensure that the onAccept() callback associated with the acceptor doesn't run until connect() has fully completed. 



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

Author:

{'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}

Message: SERVER-61804: Fix race in transport_layer_asio_test

(cherry picked from commit 0455be535f6d8149e86b828d9d75edb185c042e2)
Branch: v5.0
https://github.com/mongodb/mongo/commit/97705ef5a0283bb5f465f582d9d08259d12e9b23

Comment by Githook User [ 23/Feb/22 ]

Author:

{'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}

Message: SERVER-61804: Fix race in transport_layer_asio_test

(cherry picked from commit 0455be535f6d8149e86b828d9d75edb185c042e2)
Branch: v5.2
https://github.com/mongodb/mongo/commit/68a49ec78738d5086b85f5656ec6db25b02e7210

Comment by Githook User [ 10/Dec/21 ]

Author:

{'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}

Message: SERVER-61804: Fix race in transport_layer_asio_test
Branch: master
https://github.com/mongodb/mongo/commit/0455be535f6d8149e86b828d9d75edb185c042e2

Generated at Thu Feb 08 05:53:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.