From 06cfa3bd798b0328ae4b8e8fd18b11f7e8c554cf Mon Sep 17 00:00:00 2001 From: jannaerin Date: Wed, 13 May 2020 14:09:30 -0400 Subject: SERVER-48149 Compare exhaust iters before erasing --- src/mongo/executor/thread_pool_task_executor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongo/executor/thread_pool_task_executor.cpp b/src/mongo/executor/thread_pool_task_executor.cpp index 765c4f459a7..92ea98ab094 100644 --- a/src/mongo/executor/thread_pool_task_executor.cpp +++ b/src/mongo/executor/thread_pool_task_executor.cpp @@ -835,10 +835,10 @@ void ThreadPoolTaskExecutor::runCallbackExhaust(std::shared_ptr c // 'expectedExhaustIter' so that we can still remove this task from the 'poolInProgressQueue' if // this happens, but we do not want to reset the 'exhaustIter' value in this case. if (cbState->exhaustIter) { - _poolInProgressQueue.erase(expectedExhaustIter); if (cbState->exhaustIter.get() == expectedExhaustIter) { cbState->exhaustIter = boost::none; } + _poolInProgressQueue.erase(expectedExhaustIter); } if (_inShutdown_inlock() && _poolInProgressQueue.empty()) { -- cgit v1.2.1