gh-140947: fix contextvars handling for server tasks in asyncio #141158
gh-140947: fix contextvars handling for server tasks in asyncio #141158kumaraditya303 merged 17 commits into
Conversation
|
Any chance this can be considered a security issue? |
Sorry, something went wrong.
There are a lot of moving parts in fixing this and this PR only fixes the non-ssl part, ssl remains remains to be fixed. |
Sorry, something went wrong.
6354b14 to
f845484
Compare
January 13, 2026 14:20
…tya303/cpython; branch 'main' of https://github.com/python/cpython into asyncio-contextvars-fix
|
🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit a2039d6 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F141158%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Sorry, something went wrong.
|
I restarted the buildbot server. It seems like buildbot workers are now working properly again. |
Sorry, something went wrong.
60fbc20
into
python:main
Mar 21, 2026
Reintroduces the behavior from #2742 as an opt-in flag. When set, each ASGI request runs in a fresh contextvars.Context, which works around the asyncio context leak in python/cpython#140947 (expected to be fixed upstream for Python >=3.15 via python/cpython#141158). Default is off so context set in the lifespan or by external instrumentation (e.g. OpenTelemetry eBPF propagation) remains visible to ASGI handlers.
edited by bedevere-app
Bot
LoadingUh oh!
There was an error while loading. Please reload this page.
Copy link Copy MarkdownSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.