Skip to content

fix(telegram): reset send pool after pool timeouts - #53622

Closed
yungchentang wants to merge 1 commit into
NousResearch:mainfrom
yungchentang:fix/telegram-pool-timeout-53524
Closed

fix(telegram): reset send pool after pool timeouts#53622
yungchentang wants to merge 1 commit into
NousResearch:mainfrom
yungchentang:fix/telegram-pool-timeout-53524

Conversation

@yungchentang

@yungchentang yungchentang commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reset PTB's general Bot API request pool after a confirmed Telegram pool timeout
  • keep polling request pool resets separate so getUpdates recovery behavior stays unchanged
  • add a regression test that pool timeouts drain _request[1] before retrying and leave _request[0] untouched

Fixes #53524

Tests

  • python -m pytest tests/gateway/test_telegram_thread_fallback.py -q
  • python -m pytest tests/gateway/test_telegram_network_reconnect.py -q
  • python -m pytest tests/gateway/test_telegram_closewait_limits_31599.py -q
  • python -m pytest tests/gateway/test_telegram_send_path_health.py -q
  • python -m py_compile plugins/platforms/telegram/adapter.py tests/gateway/test_telegram_thread_fallback.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter P1 High — major feature broken, no workaround sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jun 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Competing-PR pair with #53624 — both fix #53524 via the same mechanism (drain PTB's general request pool _request[1] after a send-side pool timeout). This PR is the earlier of the two (canonical); #53624 marked duplicate. Related cluster: #38812, #43333, #35624, #41391 (same #31599 pool-exhaustion family; root CLOSE_WAIT fix merged in #51541). Maintainer chooses which to merge.

@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #54121 (#54121). Your commit was cherry-picked onto current main with your authorship preserved in git log (merge commit dddaea0). Thanks for the clean fix and the asyncio.Lock guard against concurrent drains.

@teknium1 teknium1 closed this Jun 28, 2026
pai-scaffolde pushed a commit to pai-scaffolde/hermes-agent that referenced this pull request Jun 28, 2026
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
Jasper6439 pushed a commit to Jasper6439/hermes-agent that referenced this pull request Jul 5, 2026
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P1 High — major feature broken, no workaround platform/telegram Telegram bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(gateway): Telegram HTTP connection pool exhaustion causes silent reply failure

3 participants