Commit Graph

3 Commits

Author SHA1 Message Date
Kian Jones
ea845d379d feat: improved watchdog thread (#6252)
log even when event loop is not blocked to clarify whether event loop is blocked during 'freeze' and attempt to estimate main event loop load
2025-11-24 19:09:33 -08:00
Kian Jones
19210c01b0 feat: add stacktrace dumping on event loop block (#6211)
Add stack trace dumping to watchdog

When a hang is detected, now logs:
- Full stack trace of all threads
- Exact file:line of blocking code
- Function names in the call chain

This shows you WHY the event loop is blocked, not just that it's blocked.
2025-11-24 19:09:33 -08:00
Kian Jones
71bce718f7 Add lightweight event loop watchdog monitoring (#6209)
* Add lightweight event loop watchdog monitoring

- Thread-based watchdog detects event loop hangs >15s
- Runs independently, won't interfere with normal operation
- Disabled in test environments
- Minimal overhead, just heartbeat checks every 5s

* actually test it

* Add test script to validate watchdog detects hangs

Run with: uv run python test_watchdog_hang.py

Tests:
- Normal operation (no false positives)
- Short blocks under threshold (no alerts)
- Long blocks over threshold (correctly alerts)
2025-11-24 19:09:33 -08:00