-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Networking & Observability
-
Fully Compatible
-
ALL
-
Networking & Obs 2024-12-09
-
200
The test does not process network responses after shutting down the task executor, and so it will hang during shutdown waiting for the initialSync future to be fulfilled.
This can be fixed by adding _mock->runUntilIdle(); after getExecutor().shutdown(); in the test.
Adding a sleep consistently repros this issue:
TEST_F(FileCopyBasedInitialSyncerTest, CallbackIsCalledIfExecutorIsShutdownAfterStartup) { auto* fileCopyBasedInitialSyncer = getFileCopyBasedInitialSyncer(); auto opCtx = makeOpCtx(); ASSERT_FALSE(fileCopyBasedInitialSyncer->isActive()); ASSERT_OK(fileCopyBasedInitialSyncer->startup(opCtx.get(), maxAttempts)); ASSERT_TRUE(fileCopyBasedInitialSyncer->isActive()); sleep(2); getExecutor().shutdown(); ASSERT_OK(fileCopyBasedInitialSyncer->shutdown()); fileCopyBasedInitialSyncer->join(); ASSERT_EQUALS(ErrorCodes::ShutdownInProgress, _lastApplied); }