mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #29452 from azat/clickhouse-test-fix-term
clickhouse-test: fix shared list object (by fixing manager lifetime)
This commit is contained in:
commit
75be60ff22
@ -65,11 +65,20 @@ def signal_handler(sig, frame):
|
|||||||
def stop_tests():
|
def stop_tests():
|
||||||
global stop_tests_triggered_lock
|
global stop_tests_triggered_lock
|
||||||
global stop_tests_triggered
|
global stop_tests_triggered
|
||||||
|
global restarted_tests
|
||||||
|
|
||||||
with stop_tests_triggered_lock:
|
with stop_tests_triggered_lock:
|
||||||
if not stop_tests_triggered.is_set():
|
if not stop_tests_triggered.is_set():
|
||||||
stop_tests_triggered.set()
|
stop_tests_triggered.set()
|
||||||
|
|
||||||
|
# materialize multiprocessing.Manager().list() object before
|
||||||
|
# sending SIGTERM since this object is a proxy, that requires
|
||||||
|
# communicating with manager thread, but after SIGTERM will be
|
||||||
|
# send, this thread will die, and you will get
|
||||||
|
# ConnectionRefusedError error for any access to "restarted_tests"
|
||||||
|
# variable.
|
||||||
|
restarted_tests = [*restarted_tests]
|
||||||
|
|
||||||
# send signal to all processes in group to avoid hung check triggering
|
# send signal to all processes in group to avoid hung check triggering
|
||||||
# (to avoid terminating clickhouse-test itself, the signal should be ignored)
|
# (to avoid terminating clickhouse-test itself, the signal should be ignored)
|
||||||
signal.signal(signal.SIGTERM, signal.SIG_IGN)
|
signal.signal(signal.SIGTERM, signal.SIG_IGN)
|
||||||
|
Loading…
Reference in New Issue
Block a user