If this call to Pipeline::getNext() throws, then it is possible for the PlanExecutor underlying the Pipeline's DocumentSourceCursor to still be holding locks while the OperationContext is destructed.
We should add a guard around the call to ReshardingDonorOplogIterator::_fillBatch() to call Pipeline::dispose() if Pipeline::getNext() throws.
auto guard = makeGuard([&] { pipeline->dispose(opCtx); pipeline.reset() }); pipeline->reattachToOperationContext(opCtx); auto doc = pipeline->getNext(); pipeline->detachFromOperationContext(); guard.dismiss();
- is related to
-
SERVER-56437 ReshardingDonorOplogIterator destroys OperationContext with Pipeline still attached on exception
- Closed
- related to
-
SERVER-57654 Call Pipeline::dispose() if Pipeline::getNext() throws in ReshardingCollectionCloner
- Closed
-
SERVER-57655 Call Pipeline::dispose() if Pipeline::getNext() throws in ReshardingTxnCloner
- Closed