Skip to content

Commit 1516016

Browse files
committed
Apply PR fixes
1 parent 6e34409 commit 1516016

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cluster/log-dump/log-dump.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ function dump_nodes() {
420420

421421
proc=${max_dump_processes}
422422
start="$(date +%s)"
423+
# log_dump_ssh_timeout is the maximal number of seconds the log dumping over
424+
# SSH operation can take. Please note that the logic enforcing the timeout
425+
# is only a best effort. The actual time of the operation may be longer
426+
# due to waiting for all the child processes below.
427+
log_dump_ssh_timeout_seconds="${LOG_DUMP_SSH_TIMEOUT_SECONDS:-}"
423428
for i in "${!all_selected_nodes[@]}"; do
424429
node_name="${all_selected_nodes[$i]}"
425430
node_dir="${report_dir}/${node_name}"
@@ -440,7 +445,8 @@ function dump_nodes() {
440445
proc=${max_dump_processes}
441446
wait
442447
now="$(date +%s)"
443-
if [[ ! -z "${LOG_DUMP_SSH_TIMEOUT}" && $((now - start)) -gt ${LOG_DUMP_SSH_TIMEOUT} ]]; then
448+
if [[ -n "${log_dump_ssh_timeout_seconds}" && $((now - start)) -gt ${log_dump_ssh_timeout_seconds} ]]; then
449+
echo "WARNING: Hit timeout after ${log_dump_ssh_timeout_seconds} seconds, finishing log dumping over SSH shortly"
444450
break
445451
fi
446452
fi

0 commit comments

Comments
 (0)