Call Pipeline::dispose() if Pipeline::getNext() throws in ReshardingTxnCloner

XMLWordPrintableJSON

    • Fully Compatible
    • v5.0
    • Sharding 2021-06-28
    • 1
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We should add a guard around to call Pipeline::dispose() if this call to Pipeline::getNext() throws.

      auto guard = makeGuard([&] { pipeline->dispose(opCtx); pipeline.reset() });
      pipeline->reattachToOperationContext(opCtx);
      auto doc = pipeline->getNext();
      pipeline->detachFromOperationContext();
      guard.dismiss();
      

              Assignee:
              Luis Osta (Inactive)
              Reporter:
              Max Hirschhorn
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: