[SERVER-75987] Synchronize the connection and server threads in `transport_layer_test` Created: 11/Apr/23  Updated: 29/Oct/23  Resolved: 12/Apr/23

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 7.1.0-rc0, 6.0.6, 5.0.18

Type: Bug Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0, v6.3, v6.2, v6.0, v5.0
Sprint: Service Arch 2023-04-17
Participants:
Linked BF Score: 0

 Description   

EgressConnectionResetByPeerDuringSessionCtor is designed to perform the following:

  • Start a listener thread (the server).
  • Create a connection to the server and block the connection before it attempts to set socket options (using a fail-point).
  • Have the server close the connection.
  • Verify the status that the newly created connection returns.

Currently, the server thread doesn't wait for the client to reach the fail-point. As a result, the server may close the connection before the client thread attempts to create a session. This may result in the client returning ErrorCodes::HostUnreachable through the following code-path:

  • _doSyncConnect observes a closed socket (asio::error::connection_reset) before attempting to construct the Session object.
  • This is translated to DBException, potentially through here.
  • We later on add additional details to the Status object through here.

So long as the server uses the fail-point to synchronizes with the client, this issue should be avoidable.



 Comments   
Comment by Githook User [ 01/May/23 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-75987 Synchronize the connection and server threads in `transport_layer_test`

(cherry picked from commit a78040a9e614a92220c31ec12360d6d47b8a8fbd)
Branch: v5.0
https://github.com/mongodb/mongo/commit/64158613ba2dfa8d9b1051c8aaffaa75eb965e41

Comment by Githook User [ 26/Apr/23 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-75987 Synchronize the connection and server threads in `transport_layer_test`

(cherry picked from commit a78040a9e614a92220c31ec12360d6d47b8a8fbd)
Branch: v6.0
https://github.com/mongodb/mongo/commit/2eea702bf931258a0191853c41cdafc74d23cc75

Comment by Githook User [ 12/Apr/23 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-75987 Synchronize the connection and server threads in `transport_layer_test`

(cherry picked from commit a78040a9e614a92220c31ec12360d6d47b8a8fbd)
Branch: v7.0
https://github.com/mongodb/mongo/commit/f1a26e82843f2a2654832ac15e257bf223f9a70d

Comment by Githook User [ 12/Apr/23 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-75987 Synchronize the connection and server threads in `transport_layer_test`
Branch: master
https://github.com/mongodb/mongo/commit/a78040a9e614a92220c31ec12360d6d47b8a8fbd

Generated at Thu Feb 08 06:31:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.