Skip to content

Commit 724cb86

Browse files
committed
add debug
fmt
1 parent 7dd7789 commit 724cb86

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Copyright 2020-2021 The Databend Authors.
3+
# SPDX-License-Identifier: Apache-2.0.
4+
5+
set -u
6+
7+
OUTPUT_PATH=${1:-"./.databend/async_tasks_dump.log"}
8+
INTERVAL_SECONDS=${2:-1}
9+
ENDPOINTS=${3:-"http://127.0.0.1:8080/debug/async_tasks/dump,http://127.0.0.1:8082/debug/async_tasks/dump,http://127.0.0.1:8083/debug/async_tasks/dump"}
10+
11+
mkdir -p "$(dirname "${OUTPUT_PATH}")"
12+
touch "${OUTPUT_PATH}"
13+
14+
IFS=',' read -r -a ENDPOINT_LIST <<< "${ENDPOINTS}"
15+
16+
{
17+
echo "=== async_tasks_dump collector started at $(date -u +"%Y-%m-%dT%H:%M:%SZ") ==="
18+
echo "interval_seconds=${INTERVAL_SECONDS}"
19+
echo "endpoints=${ENDPOINTS}"
20+
} >> "${OUTPUT_PATH}"
21+
22+
while true; do
23+
TIMESTAMP="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
24+
for endpoint in "${ENDPOINT_LIST[@]}"; do
25+
echo "" >> "${OUTPUT_PATH}"
26+
echo "===== ${TIMESTAMP} ${endpoint} =====" >> "${OUTPUT_PATH}"
27+
28+
curl --silent --show-error --max-time 3 "${endpoint}" >> "${OUTPUT_PATH}" 2>&1
29+
CURL_EXIT_CODE=$?
30+
if [ "${CURL_EXIT_CODE}" -ne 0 ]; then
31+
echo "[collector] curl exit code: ${CURL_EXIT_CODE}" >> "${OUTPUT_PATH}"
32+
fi
33+
done
34+
35+
sleep "${INTERVAL_SECONDS}"
36+
done

scripts/ci/ci-run-sqllogic-tests-cluster.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,26 @@ export STORAGE_ALLOW_INSECURE=true
99
echo "Starting Cluster databend-query"
1010
./scripts/ci/deploy/databend-query-cluster-3-nodes.sh
1111

12+
ASYNC_TASKS_DUMP_OUTPUT=${ASYNC_TASKS_DUMP_OUTPUT:-"./.databend/async_tasks_dump.log"}
13+
ASYNC_TASKS_DUMP_INTERVAL=${ASYNC_TASKS_DUMP_INTERVAL:-1}
14+
ASYNC_TASKS_DUMP_ENDPOINTS=${ASYNC_TASKS_DUMP_ENDPOINTS:-"http://127.0.0.1:8080/debug/async_tasks/dump,http://127.0.0.1:8082/debug/async_tasks/dump,http://127.0.0.1:8083/debug/async_tasks/dump"}
15+
16+
echo "Starting async tasks dump collector"
17+
bash ./scripts/ci/ci-collect-async-tasks-dump.sh \
18+
"${ASYNC_TASKS_DUMP_OUTPUT}" \
19+
"${ASYNC_TASKS_DUMP_INTERVAL}" \
20+
"${ASYNC_TASKS_DUMP_ENDPOINTS}" &
21+
ASYNC_TASKS_DUMP_PID=$!
22+
23+
cleanup_async_tasks_dump_collector() {
24+
if [ -n "${ASYNC_TASKS_DUMP_PID:-}" ] && kill -0 "${ASYNC_TASKS_DUMP_PID}" 2>/dev/null; then
25+
echo "Stopping async tasks dump collector"
26+
kill "${ASYNC_TASKS_DUMP_PID}" 2>/dev/null || true
27+
wait "${ASYNC_TASKS_DUMP_PID}" 2>/dev/null || true
28+
fi
29+
}
30+
trap cleanup_async_tasks_dump_collector EXIT
31+
1232
export RUST_BACKTRACE=1
1333

1434
TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http"}

src/query/service/src/servers/flight/flight_client.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ impl FlightClient {
146146
);
147147

148148
let mut response_stream = response.into_inner();
149-
debug!("[{}]FlightClient::wait first response message: path={:?}", &uuid, &path);
149+
debug!(
150+
"[{}]FlightClient::wait first response message: path={:?}",
151+
&uuid, &path
152+
);
150153
match response_stream.message().await.map_err(|status| {
151154
error!(
152155
"[{}]FlightClient::receive response failed: path={:?}, elapsed_ms={}, status={}",

0 commit comments

Comments
 (0)