fix(gateway): add adapter liveness watchdog - #46920
Conversation
|
Rebased onto |
10145d1 to
1c5ba87
Compare
|
Rebased onto |
1c5ba87 to
5aa2180
Compare
|
Thanks for the careful phase-1 framing here, @konsisumer — the routing-through-the-existing-reconnect-path design and the deliberate non-claim on Signal's quiet-traffic case were exactly right, and your clarification comment on #32574 was what scoped this whole cluster. Closing without merge, though, because the two real-world failure modes this targets are both already fixed on
That leaves the generic Not a quality judgment on the code — the design was sound. If you hit a zombie on a non-Discord platform on latest |
What changed and why
This lands a narrow phase-1 fix for the zombie-adapter class reported in #32574.
gateway.liveness_watchdogconfig block withenabled,interval, andfailure_thresholdso the gateway can periodically check live adapters without inventing a second reconnect system.BasePlatformAdapter.is_alive()with a conservative default (_running), then wired a newGatewayRunner._platform_liveness_watchdog()loop that counts consecutive failed checks and routes recovery through the existing fatal-error/reconnect path.Bot.start()task or a closed ready client is treated as dead and gets requeued for the existing reconnect watcher.How to test
pytest tests/gateway/test_platform_reconnect.py -qpytest tests/plugins/test_discord_runtime_failure.py -qpytest tests/gateway/test_runner_fatal_adapter.py -qpytest tests/gateway/test_runner_startup_failures.py -qWhat platforms tested on
Refs #32574