From 7b99d9a176f546d1d2a19e6625c9014168bfebaf Mon Sep 17 00:00:00 2001 From: serxa Date: Mon, 22 Jan 2024 23:50:53 +0000 Subject: [PATCH] wait for currently running jobs to finish #2 --- programs/server/Server.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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