fix(telegram): clear send_path_degraded immediately on successful reconnect - #35285
Closed
annguyenNous wants to merge 1 commit into
Closed
fix(telegram): clear send_path_degraded immediately on successful reconnect#35285annguyenNous wants to merge 1 commit into
annguyenNous wants to merge 1 commit into
Conversation
…onnect After a transient network interruption, the Telegram gateway successfully reconnects polling but _send_path_degraded remains True for up to 60 seconds (until the heartbeat probe runs), blocking all outbound send() calls during that window. This commit clears _send_path_degraded immediately when start_polling() succeeds in the reconnect ladder, restoring the send path without waiting for the deferred probe. The probe still runs as a safety net and will re-set the flag if the connection is actually wedged. Fixes NousResearch#35205
Collaborator
Contributor
|
Automated hermes-sweeper review: this reconnect fix is already present on current Evidence:
Thanks for the focused fix here; the prior duplicate discussion was accurate, and the requested behavior is now covered on main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35205
Problem
After a transient network interruption, the Telegram gateway successfully reconnects polling but
_send_path_degradedremainsTruefor up to 60 seconds (until the heartbeat probe runs in_verify_polling_after_reconnect()), blocking all outboundsend()calls during that window.Root Cause
In
_handle_polling_network_error(), the reconnect ladder at line ~964 resets_polling_network_error_count = 0but does NOT clear_send_path_degraded. The flag is only cleared inside_verify_polling_after_reconnect()(line ~1024) which runs after a 60-secondHEARTBEAT_PROBE_DELAY.Fix
Clear
_send_path_degradedimmediately whenstart_polling()succeeds in the reconnect ladder, restoring the send path without waiting for the deferred probe. The probe still runs as a safety net and will re-set the flag if the connection is actually wedged.Changes
gateway/platforms/telegram.py: +9 lines — clear_send_path_degradedafter successful reconnect with info log