Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-79070

Executor shutdown can cause async_rpc::getAllResponsesOrFirstErrorWithCancellation to return BrokenPromise

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Service Arch 2023-07-24, Service Arch 2023-08-07

       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. 

            Assignee:
            george.wangensteen@mongodb.com George Wangensteen
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: