[SERVER-79070] Executor shutdown can cause async_rpc::getAllResponsesOrFirstErrorWithCancellation to return BrokenPromise Created: 18/Jul/23  Updated: 29/Oct/23  Resolved: 03/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

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

Issue Links:
Depends
depends on SERVER-78524 async_rpc util getAllResponsesOrFirst... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2023-07-24, Service Arch 2023-08-07
Participants:

 Description   

 async_rpc::getAllResponsesOrFirstErrorWithCancellation takes a vector of future-like types and returns a single future that is ready when all of the input futures are ready. To do so, it chains a callback to defined here to each input future, the last of which to run will emplace a value in a promise that readies the output-future of the entire function. However, the callback is chained via getAsync here, which means that if the input future-like types are ExecutureFuture, they may not run in the case of executor shutdown. This means the promise for the output-future will eventually be destroyed without providing a value to the future, resulting in a BrokenPromise error propogating out. 

 

This is very similar to SERVER-54735 and some other related bugs, and can probably be handled either in the same way, or simply by chaining the callback via unsafeToInlineFuture. 



 Comments   
Comment by Githook User [ 07/Aug/23 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}

Message: SERVER-79070 Make async_rpc_util::getAllResponsesOrFirstErrorWithCancellation process responses even if the executor is shutdown
Branch: minh.luu-no_compile_sys-perf
https://github.com/mongodb/mongo/commit/7c0e5d8966810bfba1bd48f6ee350b4ba4f6ac40

Comment by Githook User [ 03/Aug/23 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}

Message: SERVER-79070 Make async_rpc_util::getAllResponsesOrFirstErrorWithCancellation process responses even if the executor is shutdown
Branch: master
https://github.com/mongodb/mongo/commit/7c0e5d8966810bfba1bd48f6ee350b4ba4f6ac40

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