Merge pull request #58907 from ClickHouse/Avogar-patch-1

Fix possible crash in clickhouse-local during loading suggestions
This commit is contained in:
Kruglov Pavel 2024-01-19 11:20:25 +01:00 committed by GitHub
commit 90057c6f39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -290,6 +290,11 @@ void LocalServer::cleanup()
{ {
connection.reset(); connection.reset();
/// Suggestions are loaded async in a separate thread and it can use global context.
/// We should reset it before resetting global_context.
if (suggest)
suggest.reset();
if (global_context) if (global_context)
{ {
global_context->shutdown(); global_context->shutdown();