GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Close native update coroutines cancelled while waiting for processor capacity by realchrisbarnes · Pull Request #5391 · python-telegram-bot/python-telegram-bot

Conversation

@realchrisbarnes

@realchrisbarnes realchrisbarnes commented Oct 30, 2026

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@realchrisbarnes
Close native update coroutines cancelled while waiting for processor …
2fe1743
…capacity
zeusrebolledo690-source
zeusrebolledo690-source approved these changes Nov 1, 2026
View reviewed changes
zeusrebolledo690-source
zeusrebolledo690-source approved these changes Nov 1, 2026
View reviewed changes

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

Reviewers

1 more reviewer
@zeusrebolledo690-source zeusrebolledo690-source zeusrebolledo690-source approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@realchrisbarnes @zeusrebolledo690-source
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.