mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
When the TCP connection enters CLOSE-WAIT the PTB polling task is blocked on epoll on a dead socket and never wakes. updater.stop() awaits that task and therefore hangs indefinitely. Consequence: _polling_error_task stays alive-but-blocked forever; every subsequent heartbeat probe sees it as "in-flight" and skips triggering a new reconnect; the gateway silently drops messages for hours until a manual restart. Field incident: 11-hour outage on 2026-07-04 UTC despite the heartbeat loop firing a reconnect at 01:11 — stop() blocked the entire ladder. Fix: wrap the updater.stop() call inside asyncio.wait_for(timeout=15). On TimeoutError log a warning and continue to _drain_polling_connections() + start_polling() — same recovery path, just unblocked. The heartbeat loop (PR #48496) correctly detects the dead socket and fires _handle_polling_network_error. This commit is the missing second half: ensuring the reconnect itself always completes. Test: test_handle_polling_network_error_updater_stop_timeout() simulates a hang by making stop() sleep forever and verifies that drain + start_polling are still reached after the timeout. Fixes #58270 |
||
|---|---|---|
| .. | ||
| browser | ||
| context_engine | ||
| cron_providers | ||
| dashboard_auth | ||
| disk-cleanup | ||
| google_meet | ||
| hermes-achievements | ||
| image_gen | ||
| kanban | ||
| memory | ||
| model-providers | ||
| observability | ||
| platforms | ||
| security-guidance | ||
| spotify | ||
| teams_pipeline | ||
| video_gen | ||
| web | ||
| __init__.py | ||
| plugin_utils.py | ||