From f423dced5a0239f326ccb258ed456e95ccc2d579 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 29 Dec 2022 20:06:09 +0100 Subject: [PATCH] Debug deadlock in stress test --- docker/test/stress/run.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker/test/stress/run.sh b/docker/test/stress/run.sh index 13c3a39ad4e..5398413c334 100644 --- a/docker/test/stress/run.sh +++ b/docker/test/stress/run.sh @@ -447,7 +447,13 @@ if [ "$DISABLE_BC_CHECK" -ne "1" ]; then || echo -e 'Backward compatibility check: Test script failed\tFAIL' >> /test_output/test_results.tsv rm -rf tmp_stress_output - clickhouse-client --query="SELECT 'Tables count:', count() FROM system.tables" + # We experienced deadlocks in this command in very rare cases. Let's debug it: + timeout 10m clickhouse-client --query="SELECT 'Tables count:', count() FROM system.tables" || + ( + echo "thread apply all backtrace (on select tables count)" >> /test_output/gdb.log + timeout 30m gdb -batch -ex 'thread apply all backtrace' -p "$(cat /var/run/clickhouse-server/clickhouse-server.pid)" | ts '%Y-%m-%d %H:%M:%S' >> /test_output/gdb.log + clickhouse stop --force + ) stop 1 mv /var/log/clickhouse-server/clickhouse-server.log /var/log/clickhouse-server/clickhouse-server.backward.stress.log