Skip to content

fix(telegram): add explicit read_timeout for get_updates polling#173

Merged
frostming merged 1 commit intobubbuild:mainfrom
oilbeater:fix/connection-hang
Apr 16, 2026
Merged

fix(telegram): add explicit read_timeout for get_updates polling#173
frostming merged 1 commit intobubbuild:mainfrom
oilbeater:fix/connection-hang

Conversation

@oilbeater
Copy link
Copy Markdown
Contributor

On macOS, when the machine sleeps and wakes up (e.g. closing and reopening a MacBook), the existing long-polling connection can become stale. PTB may then reuse this dead connection from its pool, and without an explicit client-side read_timeout it can hang indefinitely, leaving the bot completely unresponsive.

Set an explicit HTTPXRequest(read_timeout=30) for get_updates so that hanging connections are capped at 30s before being discarded and retried.

On macOS, when the machine sleeps and wakes up (e.g. closing and
reopening a MacBook), the existing long-polling connection can become
stale. PTB may then reuse this dead connection from its pool, and
without an explicit client-side read_timeout it can hang indefinitely,
leaving the bot completely unresponsive.

Set an explicit HTTPXRequest(read_timeout=30) for get_updates so that
hanging connections are capped at 30s before being discarded and
retried.
@frostming frostming merged commit 109e8ab into bubbuild:main Apr 16, 2026
5 checks passed
@oilbeater oilbeater deleted the fix/connection-hang branch April 16, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants