Repository navigation
Description
What happens
--install takes some answers through $(…). Bash waits for a command substitution's child outside its job table. A SIGINT that bash takes there, after the child has closed its output and when the child does not itself die of the signal, is lost: the INT trap does not run and the install goes on.
The fix for #250 (branch fix/install-sigint-leaves-no-temporary-250, not yet landed) traps SIGINT in workdir and takes place_by_rename's answers (dirname, mktemp and both owner_of calls) through a file in $WORKDIR, which is a wait bash does handle. Its comment names what it leaves: "every other $(…) can still lose one, mode_is's find and the dirname of each mkdir -p in place_skill_and_hook among them" (openRepoTools:267-277 at 14695e1). The fix for #257 (branch fix/install-rechecks-pipx-link-at-placement-257, not yet landed) adds one more to the placement loop.
Where. Line numbers are at 14695e1 (the head of #250's branch when this was filed) unless a commit is named.
mode_is:[ -n "$(find "$2" -maxdepth 0 -perm "$1" -print 2>/dev/null)" ],:1999. It is asked at:2183(755),:3520and:3569(644), and:3654and:3707(600).place_skill_and_hook:mkdir -p -- "$(dirname -- "$target")"before each skill file (:3509) and each command file (:3561).hook_write_settingshas two more of the same shape that the comment does not name:mkdir -p -- "$(dirname -- "$settings")"(:3616) andhook_tmp="$(mktemp -- "$(dirname -- "$settings")/…")"(:3618).pipx_link_match:venv="$(link_venv "$1")" || return 1, at93ab282:openRepoTools:2904(the head of A pipx link that appears between --install's planning and its placement is replaced by a regular file #257's branch when this was filed). A pipx link that appears between --install's planning and its placement is replaced by a regular file #257's branch asks it again in the placement loop atopenRepoTools' own turn (:2133), so every--installwaits there; planning asks too (:3111).place_by_rename's late-link refusal (A pipx link that appears between --install's planning and its placement is replaced by a regular file #257's branch,93ab282:openRepoTools:2073) builds its message with$(readlink -- "$target" …), after the temporary is removed and just beforedie. A SIGINT lost there turns death by SIGINT into exit 2, and in the merge of the two heads it makes the A SIGINT at any instant of --install's placement ends the run and leaves no temporary, so test_a_run_killed_mid_placement_leaves_no_temporary[SIGINT-True-cp] stops failing about once in a hundred runs #250 branch's "NO ANSWER HERE IS TAKEN WITH$(…)" (14695e1:openRepoTools:2041) literally false.
When it is lost (bash 5.2.21; the installer's INT trap text over a 2 s wait, SIGINT at 0.6 s; the light check's probes, re-run)
| The wait | SIGINT to the shell alone | SIGINT to the process group, child ignores it | SIGINT to the process group, child dies of it |
|---|---|---|---|
| a plain command | trap runs | trap runs | trap runs |
$(…), child has closed its output and lingers |
LOST: exit 0, the script goes on | LOST | trap runs |
$(…), pipe still open |
trap runs after the wait | trap runs after the wait | trap runs after the wait |
So a Ctrl-C, which is a group signal, is lost only where the child cannot die of it. For the real find, dirname and link_venv that is the instant between the child closing its output and bash reaping it, which is the instant #250's mode 1 describes ("after mktemp has exited 0, but before bash has reaped it"). For a plain command the INT trap now runs there; for a $(…) it does not. That reading is not measured with the real tools. A signal sent to the shell alone, as the #250 branch's dirname stand-in does, is lost every time. The comment at :272-274 ("lost, trapped or not") is true of that window and not of every SIGINT that lands in a $(…).
Why it matters
Low. A swallowed Ctrl-C does nothing at that instant and the install goes on until a second one; a lost SIGINT does not itself leave anything behind. It is the fault #250's fix closes for place_by_rename, left in the places #250 names, and a test that lands a SIGINT at one of them would flake as #250's did.
What a fix has to settle (nothing here is decided)
- Take each answer without
$(…), as A SIGINT at any instant of --install's placement ends the run and leaves no temporary, so test_a_run_killed_mid_placement_leaves_no_temporary[SIGINT-True-cp] stops failing about once in a hundred runs #250's branch does:dirname -- "$target" >"$WORKDIR/placing", thenread(:2087-2088). A parameter expansion could stand in for thedirnames (it differs fromdirnamefor a target directly under/).mode_isandlink_venvneed a command, so a file in$WORKDIR, or a variable the function sets.mode_isis cut out and run alone bytests/test_install_skill_and_hook.py:369and:383, so a file route needs a$WORKDIRthere. - Or decide the window is acceptable (every placement is a rename, and a second Ctrl-C ends the run) and say so, in place of an open list of "every other
$(…)". - Either way, correct the two test comments that say each owner wait lost the SIGINT (
tests/test_openrepotools_command.py:1284-1286, and:1236-1239). A SIGINT during the hold of$(owner_of …)is deferred and ends the run once the substitution finishes; only thedirnamecase loses it. The cases are still sound: they pin the conversion through a plain command and a wait the hook can land in. - For each wait converted, a case like the three A SIGINT at any instant of --install's placement ends the run and leaves no temporary, so test_a_run_killed_mid_placement_leaves_no_temporary[SIGINT-True-cp] stops failing about once in a hundred runs #250's branch adds: a stand-in first on
PATHthat gives the real answer, closes its output and holds, with the hook landing the SIGINT there. It exits 0 on the$(…)form and dies of SIGINT on the converted one.
Not run: the real installer under a real Ctrl-C at these waits. The probes use sh stand-ins, not find or link_venv. Not audited: every other $(…) reachable from install_commands. The list above is what the reviews named, plus the two hook_write_settings waits that a grep found.
Found by: the independent re-review of #250 (SHOULD 2 and N1, 2026-10-22) and the light check of #250's 14695e1 and #257's 93ab282 (part A, 2026-10-22). Filed on Brett Heap's word of 2026-10-23T14:21:33Z, by multiple choice: "Lost-SIGINT waits".
Lane: openRepoTools-5
Activity
brettheap commentedon Oct 24, 2026
CLAIMED — lane openRepoTools-5, session 0d83dca2-c18c-4bb0-99ce-896e6cafea02@Eagle, 2026-10-24T14:17:44Z, for #318
Logged in
lanes/log/openRepoTools-5.mdat0dd035bca8366ad15d29c94708e16ea60f43b8c4.The three reads (lane-collision-protocol Rule 1):
A failed mktemp -d for the workdir ends --install with exit 1 from ev…
The late refusal of a link at settings.json says only what is true in…
The comments on a lost SIGINT say it is inferred, the one on workdir'…
The branch now carries #318 as it stands, through 3100a25 (#321)
The comment above place_skill_and_hook names the bin loop's real star…
The note wip init prints beside a refused hook pair says the refusal …
The text check counts backticks, process substitutions and the substi…