Skip to content

fix(statechart): honor signals queued at worker exit - #1354

Open
hoangtuan2k5 wants to merge 1 commit into
cursor:mainfrom
hoangtuan2k5:fix/statechart-exit-signal
Open

hoangtuan2k5 wants to merge 1 commit into
cursor:mainfrom
hoangtuan2k5:fix/statechart-exit-signal

Conversation

@hoangtuan2k5

Copy link
Copy Markdown

A SIGINT or SIGTERM queued as the worker exits can be handled after the CLI publishes its output and exits successfully. Yield to the event loop before checking the stop flag so that a queued signal is handled before publishing.

Closes #1353

Validation:

  • Reproduced the issue on Linux with Node 22 before the fix: both SIGINT and SIGTERM produced exit 0 and published output.
  • Added regression tests for both signals, including the generated Claude Code harness copy.
  • Ran the issue's reproduction and a real TLC run with SIGTERM: exit 143 and no published output.
  • Ran the repository's plugin validation, generated-tree check, and skill script tests: 306 passed, 70 skipped because the CI command does not set TLA2TOOLS.
  • Verified a normal replay on Bun and Deno, and a normal run with TLC 1.7.4.

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.

statechart: a stop signal that arrives as the worker finishes publishes the output and exits 0

1 participant