Repository navigation
Open
Milestone
Description
What happens
lane-start runs under set -euo pipefail. In several places it pipes printf '%s\n' "$multi_line_value" into a reader that stops early (awk … exit, grep -q).
- Bash's builtin
printfwrites a multi-line value one line perwrite. - So once the reader has exited, the next write can get SIGPIPE.
- Under
pipefail, the pipeline's status is then 141.
Line numbers below are at 21e0829.
- A silent stop.
lane-start:1254,:1519,:1520and:3168-3179(12 lines) are plain statements of the formx="$(printf '%s\n' "$multi_line" | awk … exit)". A 141 there makeserrexitendlane-startwith no message.:1254and:1519-1520run before anything is changed.:3168-3179run after the window rename (:2647) and before the first register write (:3819). Nothing undoes the rename on exit, so the window stays renamed, with no row and no log line.- Measured: 1 in 12,000 substitutions with an awk that returns at the first record, on a 14-line value. With plain mawk, which reads to the end of input, it was 0 in 12,000.
- The wrong branch at
:2156. The line iselif printf '%s\n' "$session_ids" | grep -qx -F -- "$win_sid".grep -qstops at the first match, so a 141 makes the condition false although the uuid is recorded.- Measured: 2 in 5,000, with at least three ids and the wanted one first.
- When it is reached: this window's live session is in the lane's session list, but
live-holderdid not report it as the holder here. - What follows:
session-lanenames this lane, so neither refusal fires, and the "harness minted a new transcript" branch runs (:2190-2193). That branch:- prints that note, which is false here;
- skips the PAUSED-record fallback (
:3401); - stamps
RESUMED bythe window's session; - appends
→ harness <uuid>, with the commit text "the harness minted" (:3837-3851). The uuid then appears twice in an append-only cell, and becomes the lane's resume target.
- Under
--no-launchnothing is started. - In a launch, it would
claude --resumethe transcript that is already live in this window. The only check on that path,dup_check … resume-here, skips interactive holders. So two live processes on one transcript are possible (Amendment 18(h)). This consequence comes from reading the code, not from a run.
- The recovery report at
:3680(lrec_attn, with|| var="") can race in principle, because TREES is the second-to-last record (lanes-edit.sh:14381).- If it fires, a
resumablelane whose trees need attention is reported as quiet, and its LANE RECOVERY report is skipped. - Measured: 0 in 5,000. A control that read the first record of the same output hit 2 in 5,000.
:3674(lrec_verdict) cannot race. VERDICT is the last record on every path (lanes-edit.sh:14383,:13862,:13868), and its closing newline is the final write.
- If it fires, a
Where it is safe
lane-end: none of its sites can race.:332reads a one-line scalar.:1634,:1643and:1655read to the end.:2112is only ever called inside$( ), and its status is not read.
lanes-edit.shsets onlyset -u(:627), with nopipefail, so a pipeline's status is its last stage's. Its twoPIPESTATUSreads (:3295,:4983) sit on readers that read to the end.lane-worktreesis Python.lane-handoff: lane-handoff reads the lane lifecycle through a pipeline whose awk exits early, so under pipefail the read dies of SIGPIPE (exit 141) now and then and the handoff records no transition #280 fixes the one site there whose status is used.
How it was found
- lane-handoff reads the lane lifecycle through a pipeline whose awk exits early, so under pipefail the read dies of SIGPIPE (exit 141) now and then and the handoff records no transition #280's writer surveyed the other shell tools while fixing
lane-handoff, and lane-handoff reads the lane lifecycle through a pipeline whose awk exits early, so under pipefail the read dies of SIGPIPE (exit 141) now and then and the handoff records no transition #280's independent reviewer traced the consequences. - The rates were measured on Eagle: bash 5.2.21, GNU grep, and
mawk -W interactiveas the awk that returns at the first record. - CI's awk is gawk, which returns at the first record, so CI can hit these sites.
- The runner image is
ubuntu-24.0420261012.334.1 (Ubuntu 24.04.5). Its manifest lists gawk, which registers as/usr/bin/awkat a higher priority than mawk. - That is inferred from the image, because no log prints awk's version.
- The runner image is
The fix
- Read the producer's whole output into a variable first, then test the variable without taking a pipeline's status.
- For
:2156, usegrep -qx -F -- "$win_sid" <<<"$session_ids", or acasepattern on the newline-framed list, so that grep's status alone decides. - The other sites can parse the variable as lane-handoff reads the lane lifecycle through a pipeline whose awk exits early, so under pipefail the read dies of SIGPIPE (exit 141) now and then and the handoff records no transition #280 does, where no status is read.
- For
- Test each site deterministically, as lane-handoff reads the lane lifecycle through a pipeline whose awk exits early, so under pipefail the read dies of SIGPIPE (exit 141) now and then and the handoff records no transition #280's tests do. Pad the producer's output past the 64 KiB pipe buffer, so that a reader that exits early always leaves the producer writing.
Lane: openRepoTools-3
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
No labels
Activity
lane-start reads each restart-intent field to the end of the answer, …