Skip to content

Watchdog exits only via exit latch or deadline kill — never a racy isRunning read#95

Merged
kiki830621 merged 1 commit into
mainfrom
idd/91-externalengine-hung-adapter-flake
Jul 10, 2026
Merged

Watchdog exits only via exit latch or deadline kill — never a racy isRunning read#95
kiki830621 merged 1 commit into
mainfrom
idd/91-externalengine-hung-adapter-flake

Conversation

@kiki830621

Copy link
Copy Markdown
Member

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.isRunning spuriously reported false right after run() on the starved runner, the while isRunning watchdog exited with zero iterations, and the code fell through to an unbounded real-thread waitUntilExit().

Fix: a thread-safe ExitLatch flipped by terminationHandler (installed before run()) now gates the loop — it can exit only when the adapter is really gone or via the SIGTERM→SIGKILL deadline branch, so waitUntilExit() is bounded on both paths. The hung-adapter test stub drops from sleep 3600 to sleep 15, bounding any future watchdog regression at seconds of CI instead of an hour.

Verification

Checklist

  • Diagnose ✓ (RCA by elimination, upgraded by verify)
  • Implement (1 commit)
  • Verify ✓ (verify-gated PASS)

🤖 Generated by /idd-all. Do NOT add a GitHub close trailer — manual /idd-close after merge.

…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
kiki830621 marked this pull request as ready for review July 10, 2026 01:21
@kiki830621
kiki830621 merged commit 72c644c into main Jul 10, 2026
1 check 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.

1 participant