Repository navigation
gh-156920, gh-156698: fix ProactorEventLoop datagram transport hangs on close() and after write errors #156921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kumaraditya303
merged 23 commits into
python:main
from
graingert:fix-proactor-close-flush
Sep 16, 2026
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3006d6e
fix proactor error hang
graingert 60187dd
Merge branch 'main' into fix-proactor-error-hang
graingert d57cb23
fix DatagramTransport when errror_recieved calls sendto
graingert f843371
gh-156920: fix ProactorEventLoop datagram transports drop buffered da…
graingert bb80478
Merge branch 'main' of github.com:python/cpython into fix-proactor-er…
graingert 0db5dd3
Merge branch 'fix-proactor-error-hang' into fix-proactor-close-flush
graingert 37a9b5b
Update Lib/asyncio/proactor_events.py
graingert d8f9aae
Merge branch 'main' into fix-proactor-error-hang
graingert 9eda8d0
don't resume a closed transport
graingert 9fcd45c
Merge branch 'main' into fix-proactor-error-hang
graingert 4822ab7
add test for close called in error_recieved
graingert ce2168b
Merge branch 'fix-proactor-error-hang' into fix-proactor-close-flush
graingert b52b945
Revert "add test for close called in error_recieved"
graingert d4ee8a9
add test_datagram_write_error_close_from_callback
graingert b74ffb3
use SHORT_TIMEOUT instead of hardcoded 10
graingert 01b328a
Merge branch 'main' into fix-proactor-error-hang
graingert b43d1fc
Merge branch 'fix-proactor-error-hang' into fix-proactor-close-flush
graingert 55706b8
drop datagram write-error tests that pass without the fix
graingert 92d347c
Merge branch 'main' into fix-proactor-close-flush
graingert 757a9fb
check self._closing in Datagram _loop_reading
graingert 386268a
Apply suggestion from @kumaraditya303
graingert 5d6ac18
Merge branch 'main' into fix-proactor-close-flush
graingert 1adb870
replace arm with schedule
graingert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-156920: fix ProactorEventLoop datagram transports drop buffered da…
…tagrams on close() and never call connection_lost()
- Loading branch information
commit f843371eff4f1ccdac9008ed47ae0bf49bdb2dc1
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Misc/NEWS.d/next/Library/2026-09-04-09-18-05.gh-issue-156920.lONsKT.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Fix :mod:`asyncio` on Windows: closing a :class:`~asyncio.DatagramTransport` | ||
| under :class:`~asyncio.ProactorEventLoop` while datagrams were still queued, | ||
| or while an in-flight write failed right as ``close()`` was draining the | ||
| buffer, could strand the queued data and never call ``connection_lost()``, | ||
| hanging the close indefinitely. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.