diff options
author | Tyler Seip <Tyler.Seip@mongodb.com> | 2021-04-26 16:01:36 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-07 21:48:44 +0000 |
commit | 1ea9c3aed50fba8356c4ccc366ce03971237e995 (patch) | |
tree | 90bbc922040d8ba0c910a8ff27874b3da28983d9 /src/mongo/db/op_msg_fuzzer_fixture.cpp | |
parent | 87347c603074353eff616cdba12d1c178022a3c4 (diff) | |
download | mongo-1ea9c3aed50fba8356c4ccc366ce03971237e995.tar.gz |
SERVER-56351: Amend OpMsgFuzzerFixture destructor to properly shutdown storage engine
Diffstat (limited to 'src/mongo/db/op_msg_fuzzer_fixture.cpp')
-rw-r--r-- | src/mongo/db/op_msg_fuzzer_fixture.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/op_msg_fuzzer_fixture.cpp b/src/mongo/db/op_msg_fuzzer_fixture.cpp index 563d6112316..5efdddd3223 100644 --- a/src/mongo/db/op_msg_fuzzer_fixture.cpp +++ b/src/mongo/db/op_msg_fuzzer_fixture.cpp @@ -121,6 +121,20 @@ OpMsgFuzzerFixture::OpMsgFuzzerFixture(bool skipGlobalInitializers) _serviceContext->getStorageEngine()->notifyStartupComplete(); } +OpMsgFuzzerFixture::~OpMsgFuzzerFixture() { + 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) { if (Size < sizeof(MSGHEADER::Value)) { return 0; |