[SERVER-53993] Attach client strand before releasing the opCtx in AsyncCommandExecution tests Created: 22/Jan/21  Updated: 29/Oct/23  Resolved: 09/Feb/22

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 5.3.0, 5.2.1, 5.0.7

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

Issue Links:
Backports
Depends
Related
is related to SERVER-54510 Bind ClientStrand before destroying i... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.2, v5.1, v5.0
Sprint: Service Arch 2022-2-21
Participants:
Linked BF Score: 15
Story Points: 3

 Description   

The main thread in AsyncCommandExecution tests may attempt to release the opCtx owned by an instance of ExecutionContext (see here and here) while a worker thread is using the client strand to fulfill a promise. This would cause a data-race, as the thread that is releasing the opCtx does not have the client strand attached to it.

We should reorganize the test so that the client strand is always attached to the thread that destroys the opCtx.



 Comments   
Comment by Githook User [ 11/Feb/22 ]

Author:

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

Message: SERVER-53993 Always attach clientStrand before releasing opCtx in AsyncCommandExecution tests

(cherry picked from commit ce3f3d20ec70ee08b74dee8b3f698d1611495d63)
Branch: v5.2
https://github.com/mongodb/mongo/commit/ad79db6796c06bf6b477dcb543621c209e15bfd2

Comment by Githook User [ 11/Feb/22 ]

Author:

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

Message: SERVER-53993 Always attach clientStrand before releasing opCtx in AsyncCommandExecution tests

(cherry picked from commit ce3f3d20ec70ee08b74dee8b3f698d1611495d63)
Branch: v5.0
https://github.com/mongodb/mongo/commit/39e240b816dd1f66fc4e66f4369cb95a299feea4

Comment by Githook User [ 09/Feb/22 ]

Author:

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

Message: SERVER-53993 Always attach clientStrand before releasing opCtx in AsyncCommandExecution tests
Branch: master
https://github.com/mongodb/mongo/commit/ce3f3d20ec70ee08b74dee8b3f698d1611495d63

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