diff --git a/programs/server/Server.cpp b/programs/server/Server.cpp index 70dcff56428..6220009cd21 100644 --- a/programs/server/Server.cpp +++ b/programs/server/Server.cpp @@ -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