Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
-
Sharding EMEA 2022-08-08
-
153
Description
This unit test is intermittently failing because it wrongly assumes that this wait on a future to fail once the executor gets shut down.
This synthetic test consistently reproduces the issue:
TEST_F(ShardServerTestFixture, ShutdownExecutorDoesNotKillWaitOnFuture){
|
const std::string kExecName("CoolExecName"); |
auto net = executor::makeNetworkInterface(kExecName);
|
auto pool = std::make_unique<executor::NetworkInterfaceThreadPool>(net.get());
|
auto taskExecutor =
|
std::make_shared<executor::ThreadPoolTaskExecutor>(std::move(pool), std::move(net));
|
taskExecutor->startup();
|
|
|
SharedPromise<void> promise; |
|
|
auto chainCompletion = ExecutorFuture<void>(taskExecutor) |
.then([futureToWaitOn = promise.getFuture()](){
|
return futureToWaitOn; // Wait for the future to be marked as ready |
}).share();
|
|
// Sleep a bit before shutting down the executor to make sure the chain arrives to `return futureToWaitOn;` |
sleep(2);
|
|
|
taskExecutor->shutdown();
|
|
|
// The following line hangs forever (as long as `futureToWaitOn` is not ready) because the wait is not killed on executor shutdown |
chainCompletion.getNoThrow().ignore();
|
}
|
Attachments
Issue Links
- is related to
-
SERVER-68604 Re-enable `WaitForOngoingQueriesInvalidatedOnStepDown` unit test
-
- Closed
-