[SERVER-58112] Add explicit synchronization to TaskExecutor's exhaust command promises Created: 28/Jun/21  Updated: 29/Oct/23  Resolved: 08/Jul/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.4, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Tyler Seip (Inactive) Assignee: Tyler Seip (Inactive)
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:
v5.0
Sprint: Service Arch 2021-07-12
Participants:
Linked BF Score: 143

 Description   

BF-20271 shows that setting the result of the exhaust command promises upon destruction is insufficient to avoid deadlocks between calls to .get() on returned futures and setting the promise result, which is normally triggered by the destruction of the callback contained within the future. Unfortunately, parts of the network interface hold shared pointers to the internals of that callback, which means we can't guarantee that all references to the callback are destroyed before we block on .get(), which is a problem in unit tests where the main thread services both the test and the network interface. In this ticket, add a more explicit mechanism for setting the promise that doesn't depend on destruction of the callback.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 21/Sep/21 ]

Author:

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

Message: SERVER-58112: Add explicit synchronization to TaskExecutor's exhaust command promises
Branch: v5.0
https://github.com/mongodb/mongo/commit/dc06c2a1832b51653d7e7f1359e4522a898d56d6

Comment by Githook User [ 08/Jul/21 ]

Author:

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

Message: SERVER-58112: Add explicit synchronization to TaskExecutor's exhaust command promises
Branch: master
https://github.com/mongodb/mongo/commit/3364cab736849d175c5d783f34910d3c89d70af0

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