Skip to content

fix(runtime): cancel and reap exec watchdog timers - #1133

Merged
Hydralerne merged 2 commits into
oblien:mainfrom
AaronAbuUsama:fix/reap-exec-timer
Oct 11, 2026
Merged

Hydralerne merged 2 commits into
oblien:mainfrom
AaronAbuUsama:fix/reap-exec-timer

Conversation

@AaronAbuUsama

@AaronAbuUsama AaronAbuUsama commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Successful container execs can leave their watchdog's sleep process running until the timeout. Cancel and reap that timer before returning, while retaining the outer watchdog wait added by #989.

The watchdog now terminates its owned timer with SIGKILL: rapid SIGTERM cancellation was unreliable under BusyBox and could delay a successful command until its full timeout. The command itself still receives SIGTERM at its deadline. Argument quoting, output, exit codes, process-group targeting, and the missing-sleep/setsid fallbacks remain intact.

Closes #1132.

Verification

  • The original leak was reproduced with PostgreSQL as PID 1: three successful commands left three timers; the fix leaves none.
  • A deterministic timer-cancellation regression fails on 96255e5 (a successful command took 5.3 seconds) and passes with this correction. The focused runtime file passes all 26 tests.
  • New required Docker CI coverage runs the generated wrapper in BusyBox 1.37 and Debian/PostgreSQL: 2,000 rapid commands per image, cleanup, output and nonzero exit preservation, real deadlines, and PostgreSQL readiness afterward. Both cases passed locally.
  • An additional 10,000 rapid BusyBox commands completed without a full-timeout stall or leftover timer.
  • bun run test passed all 10 workspace tasks with Bun 1.3.14, including 4,786 adapter tests. Adapter and API typechecks and the structured-error audit passed.

The BusyBox test is part of the existing required Docker CI suite; an unavailable daemon fails that gate. Test containers use no network or published ports and are removed after each case. No API, schema, dependency, deployment-default, or init-setting change is included.

Checklist

  • One process-lifecycle fix, with no unrelated changes.
  • Regression demonstrated before the correction and verified afterward.
  • Real BusyBox and PostgreSQL tests, focused tests, full workspace suite, and relevant typechecks passed.
  • Changed code formatted without unrelated formatting changes.

@Hydralerne
Hydralerne merged commit 0cf1070 into oblien:main Oct 11, 2026
13 checks passed
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]: Successful container exec leaves watchdog sleep processes running after #989

2 participants