Repository navigation
fix(jobs): publish wrapper relay target for simple-command waits (#2983) - #3976
Merged
Merged
Conversation
A background job that takes the --internal-bg-wrapper path waited on its script child through wait_external_child without publishing a WrapperRelayTargetGuard. A group-delivered SIGINT (kill -SIGINT -- -$!, the bats CTRL-C shape) therefore found no relay target: the wrapper restored its saved disposition and re-raised, dying by the signal, and the rubash#737 PDEATHSIG arm then SIGKILLed the script child before its INT trap could run — bats file_setup_teardown #8 lost teardown_file. The pipeline path has published the target since rubash#2626; the simple-command wait now does the same for exactly the span of the wait. GNU interposes no wrapper (jobs.c wait_for job-wait semantics: delivery reaches the job's processes directly), so the wrapper must stay transparent to addressed and group-delivered signals. Verification (GNU bash 5.3.20 oracle; bats-core 1.11.0): - stock test/file_setup_teardown.bats, release build: master filter "user abort" not ok (line 118, teardown log missing); fixed filter ok and full file 17/17; oracle full file 17/17. - new pin issue2983_wrapper_simple_wait_relays_group_sigint_to_ script_child (cfg(unix)): fail-first against master code, passes with the fix; the pre-existing issue2983 pin is unchanged and green. - adjacent suites 2982/866/2729/1825/2241/1990_1991/2053: no new reds vs master; the 1825 (1) and 1990_1991 (3) failures are identical pre-existing sets on master and fixed. - Windows (X299): kill-form and jobs probes byte-identical between master and fixed binaries; the relay publish is inert off unix by design. Refs #2983 UNVERIFIED-BY-CAPTAIN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2983 — UNVERIFIED-BY-CAPTAIN
Root cause (one line)
The background wrapper's simple-command wait (
wait_external_child) never published aWrapperRelayTargetGuard, so a group-delivered SIGINT found no relay target: the wrapper re-raised and died, and the #737 PDEATHSIG arm SIGKILLed the script child before its INT trap could run — batsfile_setup_teardown#8 lostteardown_file.Fix
src/executor/external_inner.rs(+17): publishWrapperRelayTargetGuard::publish(child.id())for exactly the span ofwait_external_child— the same mechanism the pipeline path has used since #2626 (pipeline_exec.rs). GNU interposes no wrapper (jobs.cwait_forsemantics: delivery reaches the job's processes directly), so the wrapper must stay transparent to addressed/group signals on every wait shape, not only pipelines. The guard is inert outside wrapper-role processes and off unix. Plus one regression pin (+78,#[cfg(unix)]).This is fix #2 of #2983; fix #1 (attribute-transport leak) already landed via the journal gate (#3736). The earlier guard-block against touching this area (proximity to #3538) no longer applies: #3538 is closed, superseded by merged #3746.
Verification (GNU bash 5.3.20 oracle, bats-core 1.11.0)
test/file_setup_teardown.bats, release build, cloud host: master filter "user abort" →not ok 1(line 118, teardown log missing); fixed filter →ok 1, full file 17/17 ok; oracle full file 17/17.sleep 10is in the job's group, thenkill -SIGINT -- -$!): master → wait rc=130, LOG MISSING; fixed → LOG written byteardown_file. Reproduced identically on the local VM and the cloud host.issue2983_wrapper_simple_wait_relays_group_sigint_to_script_child: fail-first against master code (1 failed / old pin passed), passes with the fix; pin file 2/2.killforms (-l, group/pid ESRCH rc and message,-9 -- -1) and jobs/wait smoke are byte-identical between master and fixed binaries; the relay publish is inert off unix by design. The pre-existing issue2983 pin already fails on Windows at master (POSIX shape, ungated); the new pin is#[cfg(unix)]-gated so it adds no Windows red.Notes for the captain
sleep 2entry window is shorter than rubash's startup through the trap-heavy bats chain (kill lands during the inner run's gather phase, beforebats-exec-testexists). The release build is the verification of record; the driven probe above removes the timing race without changing the shape.c3ea05b0/49c98a50match a local commit of the same tree made on the cloud host,b62ff7a). A git bundle of that commit is kept on the cloud host at~/rubash2983-fix2983.bundleas backup.