Update clickhouse-test

This commit is contained in:
alesapin 2020-03-23 21:17:07 +03:00 committed by GitHub
parent ebf3e7b9e4
commit 9c9ce0aa37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,6 +98,7 @@ def get_processlist(client_cmd):
return "" # server seems dead
# collect server stacktraces using gdb
def get_stacktraces_from_gdb(server_pid):
cmd = "gdb -batch -ex 'thread apply all backtrace' -p {}".format(server_pid)
try:
@ -106,6 +107,7 @@ def get_stacktraces_from_gdb(server_pid):
return "Error occured while receiving stack traces from gdb: {}".format(str(ex))
# collect server stacktraces from system.stack_trace table
def get_stacktraces_from_clickhouse(client):
try:
return subprocess.check_call("{} --allow_introspection_functions=1 --query \"SELECT arrayStringConcat(arrayMap(x, y -> concat(x, ': ', y), arrayMap(x -> addressToLine(x), trace), arrayMap(x -> demangle(addressToSymbol(x)), trace)), '\n') as trace FROM system.stack_trace format Vertical\"".format(client), shell=True)