Info
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.
Top User Comments
xgen-internal-githook commented on Mon, 7 Aug 2023 02:40:03 +0000:
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
xgen-internal-githook commented on Thu, 3 Aug 2023 19:39:29 +0000:
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