Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Close native update coroutines cancelled while waiting for processor capacity - #5391

Open
realchrisbarnes wants to merge 1 commit into
python-telegram-bot:masterfrom
realchrisbarnes:codex/ptb-capacity-cleanup
Open

realchrisbarnes wants to merge 1 commit into
python-telegram-bot:masterfrom
realchrisbarnes:codex/ptb-capacity-cleanup

Conversation

@realchrisbarnes

Copy link
Copy Markdown

Close native update coroutines cancelled while waiting for processor capacity

When BaseUpdateProcessor.process_update is cancelled while waiting for its concurrency semaphore, the supplied native coroutine never reaches do_process_update and remains unclosed. Close it during cleanup if admission has not occurred. Once admitted, the subclass retains ownership; Futures and arbitrary awaitables are left untouched.

Adds native processor regressions for the queued native coroutine, untouched Future/custom awaitable (including a close method), slot recovery, and admitted subclass ownership. The regression fails on master with CORO_CREATED instead of CORO_CLOSED and passes with this change.

Related: #5390

Validation on master 9a38d8f516fd14c56ef51dc21817d8fbe44c267c, Python 3.14.9, locked upstream test/lint dependencies:

  • python -B -m pytest --disable-socket tests/ext/test_baseupdateprocessor.py: 13 passed (before the source change: 1 failed, 12 passed).
  • ruff check src/telegram/ext/_baseupdateprocessor.py tests/ext/test_baseupdateprocessor.py: passed.
  • ruff format --check src/telegram/ext/_baseupdateprocessor.py tests/ext/test_baseupdateprocessor.py: passed.

These are offline processor tests; no Bot, transport or account is constructed. The complete repository suite and other Python versions were not run. Cancellation before process_update starts executing remains the caller's responsibility.

This branch has not been deployed

No deployments
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.

1 participant