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

The `txn::sendPrepare` utility can return without having destroyed its child AsyncWorkScheduler

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.11
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Sharding 2019-04-22
    • 12

      The Transaction Coordinator's txn::sendPrepare utility instantiates its own child AsyncWorkScheduler in order to be able to cancel just its part of the work without impacting the parent.

      The lifetime of this child scheduler has to be shorter than the signaling of the future returned by txn::sendPrepare, so that the caller can use the signaling of the future for controlling the lifetime of its own objects (in this case the entire TransactionCoordinator).

      The way it is currently implemented, because prepareScheduler is moved into txn::collect's collector lambda, it will still be alive at the time when the returned future's chain is signaled.

            Assignee:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: