This is an automated email from the ASF dual-hosted git repository. hanahmily pushed a commit to branch vectorized-query in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit a9b77692f7f86b45bca8fdbf829e9c1f11c9a6cc Author: Hongtao Gao <[email protected]> AuthorDate: Mon May 11 01:00:24 2026 +0000 fix(soak): monitor tolerates missing Phase 0 files scripts/soak-monitor.sh used `wc -l < memory-alerts.log` and `stat banyand.log` without guarding for the file's existence. During Phase 0 (vec-off baseline, ~3 min) neither file exists yet; the unguarded redirect killed the monitor on its first tick under set -e. Wrap both with `[[ -f ... ]]` and treat absence as 0/fresh. The monitor now starts cleanly during Phase 0 and continues into Phase 1 when the files appear. --- scripts/soak-monitor.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/soak-monitor.sh b/scripts/soak-monitor.sh index f63c4d7ba..51526fb66 100755 --- a/scripts/soak-monitor.sh +++ b/scripts/soak-monitor.sh @@ -101,13 +101,22 @@ while true; do tick=$(( tick + 1 )) ts="$(date -u +%Y-%m-%dT%H:%M:%SZ)" - # banyand.log freshness - last_log_ts="$(stat -c %Y "${RUN}/banyand.log" 2>/dev/null || echo 0)" - log_age=$(( $(date +%s) - last_log_ts )) + # banyand.log freshness. During Phase 0 the file does not yet exist + # — treat that as "fresh" so the alert doesn't fire prematurely. + if [[ -f "${RUN}/banyand.log" ]]; then + last_log_ts="$(stat -c %Y "${RUN}/banyand.log" 2>/dev/null || echo 0)" + log_age=$(( $(date +%s) - last_log_ts )) + else + log_age=0 + fi - # MemoryTracker exhaustion lines - mem_alerts="$(wc -l < "${RUN}/memory-alerts.log" 2>/dev/null | tr -d ' ')" - mem_alerts="${mem_alerts:-0}" + # MemoryTracker exhaustion lines (file appears only in Phase 1). + if [[ -f "${RUN}/memory-alerts.log" ]]; then + mem_alerts="$(wc -l < "${RUN}/memory-alerts.log" 2>/dev/null | tr -d ' ')" + mem_alerts="${mem_alerts:-0}" + else + mem_alerts=0 + fi # Parity divergence reports diff_fail="$(count_or_zero "grep -l '\"pass\": *false' ${RUN}/diff-*.json")"
