Skip to content

fix(fizz): signals to the wrapper reach fizzbee - #472

Open
lczyk wants to merge 3 commits into
fizzbee-io:mainfrom
lczyk:fix/wrapper-orphans
Open

lczyk wants to merge 3 commits into
fizzbee-io:mainfrom
lczyk:fix/wrapper-orphans

Conversation

@lczyk

@lczyk lczyk commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

fixes #385.

  • single run: exec fizzbee, so a signal to the wrapper's pid reaches it. the temp file is removed before the exec.
  • --parallel: workers are direct background jobs instead of subshells, so killing a worker pid (on interrupt, or after another worker fails) stops its fizzbee. the parent records exit status and FAILED / DEADLOCK as before. the trap is set before spawning, covers INT, TERM and HUP, and kills $(jobs -p) (which also lists a worker started but not yet in pids) before any echo (an echo to a closed stdout would die of SIGPIPE first). no pkill, since the docker image has no procps. bash 3.2 compatible.

a model-check run stopped by SIGTERM now prints Model checker stopped and exits 0, same as Ctrl-C.

testing

  • tests/test_wrapper_signals.py: SIGTERM to the wrapper pid, single run and -x --parallel 2. fails on main, passes here. also passes with a release-style layout (release/fizz.env). not wired into ci.
  • test_references.py --skip-lovable: 172 passed, 0 failed, counts unchanged.
  • --parallel pass / fail / worker-error paths checked by hand, output unchanged.
  • SIGTERM with stdout a closed pipe, by hand: no workers left here, 2 left on main.

The wrapper ran fizzbee as a child of bash, so a SIGTERM sent to the
wrapper's pid killed bash and left fizzbee running, reparented to init.
exec it instead.

In --parallel mode each worker was a subshell waiting on fizzbee, and
killing the subshell did not reach fizzbee either, both on interrupt and
when killing survivors after a failure. Run the workers as direct
background jobs and record their exit status from the parent, so killing
a worker pid stops its fizzbee, with no extra dependency on pkill. The
trap is set before the workers start and also covers SIGHUP.

Fixes fizzbee-io#385.
A signal between launching a worker and recording its pid left that
worker out of the trap's kill. jobs -p already lists it. With stdout a
closed pipe, the first echo killed bash by SIGPIPE before any kill ran,
so kill first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: killing fizz leaves orphans

1 participant