New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shutdown during reindex-chainstate can block forever #23234
Comments
I've observed such behavior but did not notice the reasons. Thanks @luke-jr! |
I had what I think was a similar issue (scriptcheck thread hanging, waiting on void SyncWithValidationInterfaceQueue()
{
AssertLockNotHeld(cs_main);
// Block until the validation queue drains
auto promise = std::make_shared<std::promise<void>>();
CallFunctionInValidationInterfaceQueue([promise] {
promise->set_value();
});
std::future_status status;
do {
status = promise->get_future().wait_for(10s);
} while (status != std::future_status::ready); // && !ShutdownRequested());
} fixed my problem. In particular, |
I also experienced this issue - my bitcoind hanged and when I dumped the running threads, it was waiting on |
During
Shutdown
, we stop the scheduler before waiting on the load-block thread. But the load-block thread can callLimitValidationInterfaceQueue
viaActivateBestChain
.LimitValidationInterfaceQueue
then schedules a dummy call and waits for it. But since the scheduler has stopped, it never gets there, and blocks forever. Shutdown remains joined to the thread, and also never exits.Can we just wait for the load-block thread before killing the scheduler?
The text was updated successfully, but these errors were encountered: