From 16ce9d71e1aea5a0244ddf0e7d547425b2671b2f Mon Sep 17 00:00:00 2001 From: Amirsaman Memaripour Date: Mon, 22 Mar 2021 18:58:12 +0000 Subject: SERVER-54365 Allow ClientOutOfLineExecutor to skip shutdown --- src/mongo/db/client_out_of_line_executor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/client_out_of_line_executor.cpp') diff --git a/src/mongo/db/client_out_of_line_executor.cpp b/src/mongo/db/client_out_of_line_executor.cpp index e2fe618165f..f82612266ba 100644 --- a/src/mongo/db/client_out_of_line_executor.cpp +++ b/src/mongo/db/client_out_of_line_executor.cpp @@ -55,6 +55,8 @@ ClientOutOfLineExecutor::ClientOutOfLineExecutor() noexcept : _impl{std::make_unique()}, _taskQueue{std::make_shared()} {} ClientOutOfLineExecutor::~ClientOutOfLineExecutor() noexcept { + if (!_requireShutdown.load()) + return; invariant(_isShutdown); } @@ -83,7 +85,7 @@ ClientOutOfLineExecutor* ClientOutOfLineExecutor::get(const Client* client) noex } void ClientOutOfLineExecutor::schedule(Task task) { - _taskQueue->push(std::move(task)); + getHandle().schedule(std::move(task)); } void ClientOutOfLineExecutor::consumeAllTasks() noexcept { -- cgit v1.2.1