[SERVER-68603] Temporarily disable `TaskWaitingForOngoingQueriesInvalidatedOnStepDown` unit test Created: 05/Aug/22  Updated: 29/Oct/23  Resolved: 05/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Pierlauro Sciarelli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-68604 Re-enable `WaitForOngoingQueriesInval... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding EMEA 2022-08-08
Participants:
Linked BF Score: 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();
}


Generated at Thu Feb 08 06:11:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.