Repository navigation
fix(telegram): keep the long poll connected and heal short blips - #37
Merged
Merged
Conversation
Measured on a deployed instance over nine days: 150 read timeouts, 37 connection resets, 73 DNS failures and 127 gateway errors on getUpdates, nearly all single events that the next poll survived. Every poll opened a new TCP and TLS connection and resolved the name again, and every failure was recorded as channel.error. - Poll over one kept-alive session with TCP keepalive probes (15 s idle, 3 probes 5 s apart), so a dropped route surfaces after about 30 s instead of at the 60 s read deadline. Connecting gets its own 10 s deadline. - Retry getUpdates with the unchanged offset for transient failures (timeout, reset, DNS, 5xx, short 429) for at most 20 s on a fresh connection. A second consecutive read timeout, a lasting outage and any rejection (401, 409, other 4xx) are raised as before. What this changes for an operator: a blip that heals within the window no longer writes channel.error. Silence stays bounded, so a cut-off channel is still reported. Sends are untouched and keep their single attempt. No kernel module is involved. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What
The Telegram long poll now uses one kept-alive connection with TCP keepalive probes, and it retries
getUpdatesitself for failures that cannot have changed anything.Why
Nine days of a deployed instance's event log: 150 read timeouts, 37 connection resets, 73 DNS failures and 127 gateway errors on
getUpdates. Nearly all were single events that the next poll survived. Each poll opened a new TCP and TLS connection and did its own DNS lookup, and each failure was written aschannel.error.Behaviour
poll_all.Evidence
Not yet shown: the effect on the daily error count. That needs several days of the deployed instance.
The collected test count moves from 3583 to 3607, so the README, CLAUDE.md and site counters are updated in the same commit.
🤖 Generated with Claude Code