Watchdog exits only via exit latch or deadline kill — never a racy isRunning read#95
Merged
Merged
Conversation
…cy isRunning read (#91) The CI hang signature (test ran the stub's full 3600 s, error message lacked 'timeout') proves the kill branch never executed: Process.isRunning spuriously reported false right after run() on the starved runner, the 'while isRunning' watchdog exited on the spot, and waitUntilExit() blocked unbounded. A terminationHandler-set thread-safe latch (installed before run()) now gates the loop, so it can exit only when the adapter is really gone or after SIGTERM/SIGKILL; waitUntilExit is bounded on both paths. The hung-adapter stub drops to sleep 15 so any future regression costs seconds of CI, not an hour. Refs #91
kiki830621
marked this pull request as ready for review
July 10, 2026 01:21
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 #91
Summary
The 1-hour CI hang signature (test ran the hung stub's full 3600 s, thrown error lacked 'timeout') proves the kill branch never executed:
Process.isRunningspuriously reported false right afterrun()on the starved runner, thewhile isRunningwatchdog exited with zero iterations, and the code fell through to an unbounded real-threadwaitUntilExit().Fix: a thread-safe
ExitLatchflipped byterminationHandler(installed beforerun()) now gates the loop — it can exit only when the adapter is really gone or via the SIGTERM→SIGKILL deadline branch, sowaitUntilExit()is bounded on both paths. The hung-adapter test stub drops fromsleep 3600tosleep 15, bounding any future watchdog regression at seconds of CI instead of an hour.Verification
ExternalEngineTestsrepeated ×5 locally (~1.5 s hung case, ~0.06 s fast adapters).Checklist
🤖 Generated by /idd-all. Do NOT add a GitHub close trailer — manual /idd-close after merge.