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

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

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

      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@mongodb.com Luis Osta (Inactive)
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: