summaryrefslogtreecommitdiff
path: root/src/mongo/db/op_msg_fuzzer_fixture.cpp
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2022-05-16 14:58:50 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-16 15:36:22 +0000
commit290133720f2c7c4ed7fd438d136809ba7935d530 (patch)
tree5011b23b928402e9e58b904233ecf1a0b70febf1 /src/mongo/db/op_msg_fuzzer_fixture.cpp
parent4afa98e3a445ee7f6738c8717f7283c2ef6eeefd (diff)
downloadmongo-290133720f2c7c4ed7fd438d136809ba7935d530.tar.gz
SERVER-66455 Revert SERVER-58194 `ThreadContext` present as cleaning up `OpMsgFuzzerFixture`
Diffstat (limited to 'src/mongo/db/op_msg_fuzzer_fixture.cpp')
-rw-r--r--src/mongo/db/op_msg_fuzzer_fixture.cpp29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/mongo/db/op_msg_fuzzer_fixture.cpp b/src/mongo/db/op_msg_fuzzer_fixture.cpp
index 1b6172532ca..190e88e5988 100644
--- a/src/mongo/db/op_msg_fuzzer_fixture.cpp
+++ b/src/mongo/db/op_msg_fuzzer_fixture.cpp
@@ -126,24 +126,17 @@ OpMsgFuzzerFixture::OpMsgFuzzerFixture(bool skipGlobalInitializers)
}
OpMsgFuzzerFixture::~OpMsgFuzzerFixture() {
- // The following ensures a thread-local instance of `ThreadContext` is available when running
- // the destructor code. This is necessary as the main thread uses static storage for the
- // instance of `OpMsgFuzzerFixture`, which is not destroyed until after all thread-locals are
- // destructed. See SERVER-58194 for more details.
- stdx::thread thread([this] {
- CollectionShardingStateFactory::clear(_serviceContext);
-
- {
- auto clientGuard = _clientStrand->bind();
- auto opCtx = _serviceContext->makeOperationContext(clientGuard.get());
- Lock::GlobalLock glk(opCtx.get(), MODE_X);
- auto databaseHolder = DatabaseHolder::get(opCtx.get());
- databaseHolder->closeAll(opCtx.get());
- }
-
- shutdownGlobalStorageEngineCleanly(_serviceContext);
- });
- thread.join();
+ CollectionShardingStateFactory::clear(_serviceContext);
+
+ {
+ auto clientGuard = _clientStrand->bind();
+ auto opCtx = _serviceContext->makeOperationContext(clientGuard.get());
+ Lock::GlobalLock glk(opCtx.get(), MODE_X);
+ auto databaseHolder = DatabaseHolder::get(opCtx.get());
+ databaseHolder->closeAll(opCtx.get());
+ }
+
+ shutdownGlobalStorageEngineCleanly(_serviceContext);
}
int OpMsgFuzzerFixture::testOneInput(const char* Data, size_t Size) {