Skip to content

fix: stop a single custom-rule host at its next invocation when interrupted - #1535

Merged
chio-labs-delivery[bot] merged 1 commit into
mainfrom
fix/single-host-interrupt
Nov 17, 2026
Merged

chio-labs-delivery[bot] merged 1 commit into
mainfrom
fix/single-host-interrupt

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Why

Pressing Ctrl-C while custom rules ran on a single host, the default for small projects, waited until that host had run every invocation. Only split hosts had a cancellation marker. A single-host run, the single-host fallback after a failed split and the stateful rerun had none, and the fallback did not check for interrupts at all.

Changes

  • Every host run goes through the same cancellable path as split hosts: a fresh cancellation marker per run, and a wait that polls for interrupts and sets the marker. An interrupt now stops the host after the invocation in flight.
  • Module-state detection used to be switched on by the presence of a marker. It is now its own detect_state flag on the host payload and CustomHostPartition, still set only for split hosts, so slice output and caching are unchanged.

DuckShop: no case applies; this changes interrupt handling, not a project shape, data value or lifecycle sequence.

Verification

  • New test: a single-host run and the single-host fallback are interrupted mid-run. Each ends in KeyboardInterrupt with at most one invocation started after the interrupt, the expected number of host launches, no host inputs and no child processes left. It fails on the previous code.
  • The rule engine tests pass with SIGINT handled and ignored.
  • make check-ci passes. make test passes apart from the Postgres publication tests, which need Docker and can't run in this environment.

…rupted

Ctrl-C during custom rules that run on one host, the default for small
projects, waited until that host had run every invocation. Only split
hosts had a cancellation marker; a single-host run, the single-host
fallback after a failed split and the stateful rerun had none, and the
fallback did not check for interrupts at all.

Every host run now gets its own cancellation marker and waits for its
host the way split hosts do, so an interrupt stops the host after the
invocation in flight. Module-state detection, which the marker used to
switch on, is now its own flag, still set only for split hosts.
@chio-labs-delivery
chio-labs-delivery Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit fce05cd Nov 17, 2026
32 checks passed
@chio-labs-delivery
chio-labs-delivery Bot deleted the fix/single-host-interrupt branch November 17, 2026 05:41
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.

1 participant