wait for currently running jobs to finish #2

This commit is contained in:
serxa 2024-01-22 23:50:53 +00:00
parent a1de16d660
commit 7b99d9a176

View File

@ -1746,7 +1746,10 @@ try
// to avoid simultaneously running table startups and destructing databases.
SCOPE_EXIT_SAFE(
LOG_INFO(log, "Stopping AsyncLoader.");
global_context->getAsyncLoader().stopAndDoNotWait(); // Note that currently running jobs will proceed
// Waits for all currently running jobs to finish and do not run any other pending jobs.
// Pending jobs will be canceled and destructed later by `load_metadata_tasks` dtor.
global_context->getAsyncLoader().stop();
);
try