mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
f15a5461be
If you will execute 'SYSTEM RELOAD CONFIG' via, i.e., TCP protocol, then reload on port change will endlessly wait for connection from which this query had been issued, and you will see the following message in the logs: 2022.04.28 03:34:57.552513 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Debug> executeQuery: (from 127.0.0.1:11774) system reload config ... 2022.04.28 03:34:57.710640 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Information> Application: Stopped listening for http://127.0.0.1:18123 2022.04.28 03:34:57.798774 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Information> Application: Stopped listening for native protocol (tcp): 127.0.0.1:19000 ... 2022.04.28 03:34:57.901375 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Debug> Application: Server finished: http://127.0.0.1:18123 2022.04.28 03:34:57.901455 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Trace> Application: Waiting server to finish: native protocol (tcp): 127.0.0.1:19000 2022.04.28 03:34:58.001717 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Trace> Application: Waiting server to finish: native protocol (tcp): 127.0.0.1:19000 2022.04.28 03:34:58.101881 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Trace> Application: Waiting server to finish: native protocol (tcp): 127.0.0.1:19000 ... 2022.04.28 03:35:01.707951 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Trace> Application: Waiting server to finish: native protocol (tcp): 127.0.0.1:19000 But waiting for the current connection will never ends. So instead of waiting directly from the query context (SYSTEM RELOAD CONFIG) do this in background (actually not even in background, but check on server reload and on exit). v0: just don't wait for the servers v2: fix use-after-free by removing dependency from server in handlers v3: wait servers in background to avoid use-after-free of the context Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com> |
||
---|---|---|
.. | ||
config.d | ||
users.d | ||
.gitignore | ||
clickhouse-server.cpp | ||
CMakeLists.txt | ||
config.xml | ||
config.yaml.example | ||
embedded.xml | ||
MetricsTransmitter.cpp | ||
MetricsTransmitter.h | ||
play.html | ||
Server.cpp | ||
Server.h | ||
users.xml | ||
users.yaml.example |