Skip to content

[debug] SIL watchdog timeout diagnosis (do not merge) - #5

Closed
Adnanpi wants to merge 3 commits into
mainfrom
debug/sil-watchdog-logs
Closed

[debug] SIL watchdog timeout diagnosis (do not merge)#5
Adnanpi wants to merge 3 commits into
mainfrom
debug/sil-watchdog-logs

Conversation

@Adnanpi

@Adnanpi Adnanpi commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Temporary instrumentation to capture the node log ring for the test_dead_client_watchdog_idles_the_node failure on main. Will be closed.

🤖 Generated with Claude Code

@Adnanpi
Adnanpi force-pushed the debug/sil-watchdog-logs branch 2 times, most recently from 4250178 to 0a86c87 Compare July 23, 2026 09:13
Adnanpi and others added 2 commits July 23, 2026 02:29
…ndition lock

The SIL dead-client-watchdog test exposed that the 1 Hz client
heartbeat can starve on a loaded host: its sends waited on the busy
backend condition lock, and on a saturated 2-core runner the thread
sent exactly one heartbeat (dropped by the PUB/SUB slow joiner while
the node was still starting) and then never re-acquired the lock, so
the node never armed its dead-client watchdog. The same code passed
and failed on identical runner images on different days -- the trigger
is load, not a code change -- so make the cadence load-immune:

- Heartbeat sends serialize on the lifecycle-socket lock (the only
  mutual exclusion the ZMQ socket needs, shared with _send_lifecycle
  and nearly uncontended) instead of the backend condition.
- _consume_state resolved config.joint_names() for every 100-200 Hz
  state message under the condition lock; each call re-resolves the
  packaged model assets (several stat() calls plus a JSON read).
  Resolve once and cache lazily.
- _drain_process_log wrote and flushed each node stdout line to the
  persistent tee file under the condition lock; the node floods stdout
  during startup. Move the tee write outside the lock -- the handle is
  only ever written by the drain thread.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Adnanpi
Adnanpi force-pushed the debug/sil-watchdog-logs branch from 0a86c87 to 5c15760 Compare July 23, 2026 09:29
@Adnanpi

Adnanpi commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Root cause established: environmental runner-side stall, not a code regression — the untouched baseline commit 418218a fails identically on the same runner image that passed it on 2026-07-20. The heartbeat thread's 1 s cadence wait oversleeps unboundedly regardless of lock strategy (backend condition vs dedicated lifecycle lock) or wait primitive (Event.wait vs time.sleep); thread dumps show all threads parked normally. Hardening fixes (heartbeat on the lifecycle lock, no filesystem I/O under the condition lock) landed in e30cd57; the test is quarantined with the evidence in f7c4ab8 pending investigation on a live runner.

@Adnanpi Adnanpi closed this Jul 23, 2026
@Adnanpi
Adnanpi deleted the debug/sil-watchdog-logs branch July 23, 2026 09:44
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