GeezerVison is showing github.com — cold-store-reaper: nightly-backup status step spuriously FAILED when status prints >20 lines — head closes the pipe, SIGPIPE + pipefail fail a healthy run · Issue #1430 · developing-today/code
cold-store-reaper: nightly-backup status step spuriously FAILED when status prints >20 lines — head closes the pipe, SIGPIPE + pipefail fail a healthy run #1430DescriptionBug
scripts/nightly-backup.sh's status step can mark the whole nightly run FAILED even when cold-store status succeeds — a race between head closing the pipe and the producer finishing its writes.
The step (nightly-backup.sh, status block):
if "${COLD_STORE}" status | head -n 20; then
The script runs with set -uo pipefail, so the pipeline's exit status is the producer's when the producer is the failing element. When status output exceeds 20 lines, head exits after line 20 and closes the read end; a producer still writing gets SIGPIPE (a shell producer exits 141; the real cold-store is Python, which converts SIGPIPE into BrokenPipeError at flush and exits non-zero). Whether the producer finishes first depends on output size and scheduling — so the step flips between ok and FAILED on identical healthy state.
Reproduction (verified this run, main 37418e56)
Using the script's own documented test seams (COLD_STORE_BIN, EXPORT_TURSO_BIN) with a stub cold-store whose status prints 100 lines and always exits 0, and a stub export-turso that succeeds:
- run 1:
step status: ok, exit 0
- run 2:
step status: ok, exit 0
- run 3:
step status: FAILED, script exit 1, FAILED steps: status — every step actually succeeded
The existing tests in tests/test_nightly_backup.py cannot catch this: their stub status prints exactly one line (stub status summary: objects 0 cold), so head never closes early.
Why it matters
The nightly backup is the cold store's core ritual, and PR #1373 just reworked this script specifically so failures stay loud but not contagious. This bug does the opposite: a spurious status failure makes a fully healthy night exit 1 and report FAILED steps: status, training the operator to ignore the run's verdict — and the failure probability grows every time cold-store status output grows past 20 lines (it is described in the script header itself as a summary shown via head, i.e. truncation is expected).
Acceptance criteria
- The status step reports ok whenever
cold-store status itself exits 0, regardless of how many lines it prints (verify with a stub printing several hundred lines, run repeatedly — e.g. 20 consecutive runs, zero spurious failures).
- A genuinely failing
cold-store status (non-zero exit) still marks the step FAILED and the script still exits non-zero at the end.
- The printed summary is still truncated for display (~20 lines) — the fix must not dump unbounded status output into the nightly log.
-
tests/test_nightly_backup.py gains a case whose stub status prints more than 20 lines and asserts step status: ok + exit 0, alongside the existing isolation cases.
Activitydeveloping-today commented on Oct 27, 2026 dezren39 commented on Oct 27, 2026 Filed this run by the new-issue-creator (lane A). Reproduced on main 37418e56 via the script's own COLD_STORE_BIN/EXPORT_TURSO_BIN test seams: a stub cold-store status printing 100 lines and exiting 0 made the run report step status: FAILED and exit 1 in 1 of 3 runs (head -n 20 closes the pipe; SIGPIPE + pipefail). The existing nightly tests use a one-line stub status, so they cannot see it.
- Session / ID: cron new-issue-creator-code-a run 2026-10-27 10:05 CDT
- Found via: filed this run
- Task: filed the issue; queued a small-fix packet
- Expectation: effort/s — done when the status step's verdict depends only on cold-store status's own exit code, display truncation retained, and a >20-line stub-status regression test exists
- Links: packet enqueued to repo-health-code-pilot this run
dezren39 commented on Oct 28, 2026 Queue task 1434 progress — fix pushed.
What changed (scope-limited to the status step + regression test):
pkgs/cold-store-reaper/scripts/nightly-backup.sh: status step no longer pipes cold-store status directly into head -n 20 under set -o pipefail. It captures full output to a mktemp file, records cold-store's own exit code, then head -n 20 the file purely for display. Verdict depends only on cold-store's exit code; FAILED line now includes the exit code, matching run_step style.
pkgs/cold-store-reaper/tests/test_nightly_backup.py: new test_long_status_output_still_ok_and_truncated with a 300-line stub status asserting exit 0, step status: ok, lines 1–20 shown, lines 21/300 absent.
Test results (laptop, repo conventions):
python3 -m unittest pkgs/cold-store-reaper/tests/test_nightly_backup.py -v: 4/4 OK
- 20 consecutive runs with 300-line stub status (exit 0): 0 spurious failures, display exactly 20 lines
- Forced failing status (STUB_FAIL_STEP=status):
step status: FAILED (exit 3), script exit 1, display still truncated
PR: #1774 (references #1430, not merged). dezren39 commented on Oct 28, 2026 🤖 Dispatcher binding · openchamber-dispatcher run 2026-10-28 13:45 CDT (burn-by-expiry run: Drew directive 13:44 CDT — fill free session slots, burn the Go window resetting 2:26 PM and the Meta window resetting 4:23 PM)
- Queue task: 1434 (repo-health-code-pilot,
small_fix) ↔ issue cold-store-reaper: nightly-backup status step spuriously FAILED when status prints >20 lines — head closes the pipe, SIGPIPE + pipefail fail a healthy run #1430
- Session:
ses_e7c242effffelJMyBEjTqBEMM6 (laptop OpenChamber, agent build)
- Pool: Workhorse, Meta-seated — requested direct model
meta/muse-spark-1.3-contributor (Meta pool, Muse Code High Usage plan; fresh quota read this run ~13:47 CDT: 5h 1% / weekly 11%, reset 4:23 PM — OPEN, plan quota only, never PAYG; seated on Meta per the run's burn-by-expiry directive so the Meta 5h window does not expire near-0%)
- Worktree / branch:
~/git/fleet/1434-1430-nightly-backup-sigpipe on the laptop, branch queue/1434-1430-nightly-backup-sigpipe (from origin/main 35726e8)
- Verified engaged: session busy on re-reads and already reporting completion in-session: fix pushed, PR opened (not merged), issue checkpointed by the session itself — the babysitter/lane harvests from here. The queue task itself remains
queued in the fleet queue (no targeted claim/binding verb exists yet — Dispatcher v1 live: scheduled launches of OpenCode/OpenChamber sessions for queued issues #1337/Routing policy alignment: map OpenChamber routing categories to the fleet's Workhorse-first tiers + POOL MAP gates #1272); the owning lane reconciles/harvests from here, and the babysitter shepherds the session.
dezren39 commented on Oct 29, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|