Attempt to wait until server is responsive after gdb detach

This commit is contained in:
Raúl Marín 2023-10-25 10:15:35 +00:00
parent 6068277af9
commit ef2740052e

View File

@ -131,20 +131,17 @@ def prepare_for_hung_check(drop_databases: bool) -> bool:
# We attach gdb to clickhouse-server before running tests
# to print stacktraces of all crashes even if clickhouse cannot print it for some reason.
# However, it obstruct checking for hung queries.
# However, it obstructs checking for hung queries.
logging.info("Will terminate gdb (if any)")
call_with_retry("kill -TERM $(pidof gdb)")
call_with_retry("tail --pid=$(pidof gdb) -f /dev/null")
# Sometimes there is a message `Child process was stopped by signal 19` in logs after stopping gdb
call_with_retry(
"kill -CONT $(cat /var/run/clickhouse-server/clickhouse-server.pid)"
"kill -CONT $(cat /var/run/clickhouse-server/clickhouse-server.pid) && clickhouse client -q 'SELECT 1 FORMAT Null'"
)
# ThreadFuzzer significantly slows down server and causes false-positive hung check failures
call_with_retry("clickhouse client -q 'SYSTEM STOP THREAD FUZZER'")
call_with_retry(make_query_command("SELECT 1 FORMAT Null"))
call_with_retry(make_query_command("SYSTEM STOP THREAD FUZZER"))
# Some tests execute SYSTEM STOP MERGES or similar queries.
# It may cause some ALTERs to hang.
# Possibly we should fix tests and forbid to use such queries without specifying table.