From 5435cff37e3c04a3adc3eba0314c094a2504407f Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 21 Jul 2026 06:05:03 +0000 Subject: [PATCH] fix(ci): redis_setexz must not break its pipe when redis is unavailable --- ci3/source_redis | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ci3/source_redis b/ci3/source_redis index 6bf9a3b94809..6b16bcbd0662 100644 --- a/ci3/source_redis +++ b/ci3/source_redis @@ -81,7 +81,16 @@ function redis_cli { } function redis_setexz { - gzip | redis_cli -x SETEX $1 $2 &>/dev/null + # When redis is unavailable, redis_cli is a no-op that never reads its stdin, so a + # bare `gzip | redis_cli` leaves gzip writing into an already-closed pipe. gzip dies + # with "gzip: stdout: Broken pipe" and, under `set -euo pipefail`, that aborts the + # whole run at the first log write (e.g. the nightly debug build, which has no redis + # on the GitHub-hosted runner). Drain stdin instead so the producer completes cleanly. + if [ "${CI_REDIS_AVAILABLE:-0}" -eq 1 ]; then + gzip | redis_cli -x SETEX $1 $2 &>/dev/null + else + cat >/dev/null + fi } function redis_getz {