summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency
diff options
context:
space:
mode:
authorJiawei Yang <jiawei.yang@mongodb.com>2023-03-29 18:42:16 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-03-30 18:51:41 +0000
commitb5f1d6bb8c06742cde53f028fd266eff584a2537 (patch)
treeed87f3936e635da175b860359aba30ff15424487 /src/mongo/db/concurrency
parent4714df5896ddaa06f3146531d2283a013f903996 (diff)
downloadmongo-b5f1d6bb8c06742cde53f028fd266eff584a2537.tar.gz
Revert "SERVER-70127 change system operation threads to be killable by default"
This reverts commit 9f2867c9da77e2d64df3852f7d4578f10e6f0817. Revert "SERVER-75352 OplogBatcher's ReplBatcher thread should be unkillable" This reverts commit 26266d5b736f90961a328399dea5d299cd407ab2.
Diffstat (limited to 'src/mongo/db/concurrency')
-rw-r--r--src/mongo/db/concurrency/d_concurrency_bm.cpp7
-rw-r--r--src/mongo/db/concurrency/deferred_writer.cpp3
2 files changed, 3 insertions, 7 deletions
diff --git a/src/mongo/db/concurrency/d_concurrency_bm.cpp b/src/mongo/db/concurrency/d_concurrency_bm.cpp
index acef49812cc..e8c4f5639f1 100644
--- a/src/mongo/db/concurrency/d_concurrency_bm.cpp
+++ b/src/mongo/db/concurrency/d_concurrency_bm.cpp
@@ -82,13 +82,6 @@ public:
for (int i = 0; i < k; ++i) {
auto client = getGlobalServiceContext()->makeClient(str::stream()
<< "test client for thread " << i);
-
- // TODO(SERVER-74657): Please revisit if this thread could be made killable.
- {
- stdx::lock_guard<Client> lk(*client.get());
- client.get()->setSystemOperationUnKillableByStepdown(lk);
- }
-
auto opCtx = client->makeOperationContext();
clients.emplace_back(std::move(client), std::move(opCtx));
}
diff --git a/src/mongo/db/concurrency/deferred_writer.cpp b/src/mongo/db/concurrency/deferred_writer.cpp
index 0d77b21f9e8..6979343fdc9 100644
--- a/src/mongo/db/concurrency/deferred_writer.cpp
+++ b/src/mongo/db/concurrency/deferred_writer.cpp
@@ -154,6 +154,9 @@ void DeferredWriter::startup(std::string workerName) {
options.maxThreads = 1;
options.onCreateThread = [](const std::string& name) {
Client::initThread(name);
+
+ stdx::lock_guard<Client> lk(cc());
+ cc().setSystemOperationKillableByStepdown(lk);
};
_pool = std::make_unique<ThreadPool>(options);
_pool->startup();