-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
ALL
-
TIG 2018-07-16
-
46
session_catalog_test.cpp and sharding_catalog_manager_add_shard_test.cpp use Client::initThreadIfNotAlready() in async code but are missing a corresponding ON_BLOCK_EXIT([&] { Client::destroy(); }) which became required as part of SERVER-34798. For reasons that I don't quite understand the _clients.empty() invariant is only triggered on Windows.
stdx::async(stdx::launch::async, [&] { Client::initThreadIfNotAlready(); auto sideOpCtx = Client::getCurrent()->makeOperationContext(); auto scopedSession = SessionCatalog::get(sideOpCtx.get())->getOrCreateSession(sideOpCtx.get(), lsid); ASSERT(scopedSession.get()); ASSERT_EQ(lsid, scopedSession->getSessionId()); }).get(); ocs.reset(); stdx::async(stdx::launch::async, [&] { Client::initThreadIfNotAlready(); auto sideOpCtx = Client::getCurrent()->makeOperationContext(); auto scopedSession = SessionCatalog::get(sideOpCtx.get())->getOrCreateSession(sideOpCtx.get(), lsid); ASSERT(scopedSession.get()); ASSERT_EQ(lsid, scopedSession->getSessionId()); }).get();
https://github.com/mongodb/mongo/blob/a6e2c10af2dcfa862c6afa0fb1504a5d2b092d09/src/mongo/db/session_catalog_test.cpp#L122-L142
https://github.com/mongodb/mongo/blob/a6e2c10af2dcfa862c6afa0fb1504a5d2b092d09/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp#L407
- is caused by
-
SERVER-34798 Replace subclasses of ServiceContext with decorations and flexible initialization code
- Closed
- related to
-
SERVER-36400 Explicitly destroy the client on exiting the run body of each BackgroundJob
- Closed