Skip to content

Conversation

jb2170
Copy link
Contributor

@jb2170 jb2170 commented Dec 2, 2024

Closes #127529

All good to go. ConnectionAbortedError now continues instead of returning. Improves OpenBSD performance. Full writeup in the issue.

I've left InterruptedError grouped with BlockingIOError to both return early, instead of InterruptedError continueing and BlockingIOError returning. PEP-475 should make InterruptedError never appear right, but hey if it's not broken don't fix it. Best to play it safe with the urgency of signals, especially as asyncio uses them for a wakeup fd.

@jb2170 jb2170 changed the title gh-127529: Correct asyncio.BaseSelectorEventLoop._accept_connection's behaviour for handling ConnectionAbortedError gh-127529: Correct asyncio.selector_events.BaseSelectorEventLoop._accept_connection's behaviour for handling ConnectionAbortedError Dec 2, 2024
…tLoop._accept_connection's behaviour for handling ConnectionAbortedError
@jb2170
Copy link
Contributor Author

jb2170 commented Dec 2, 2024

Force pushes to correct typo / my suckiness at reStructuredText

@jb2170
Copy link
Contributor Author

jb2170 commented Dec 28, 2024

@1st1 @asvetlov @kumaraditya303 @willingc Trivial PR to review + merge before the new year / before it fades out of memory? 🚀

@kumaraditya303
Copy link
Contributor

You need to add tests for this.

…abortederror to test graceful handling of ConnectionAbortedError
@jb2170
Copy link
Contributor Author

jb2170 commented Dec 29, 2024

Hi @kumaraditya303 , thanks for the reply!

I've added a test to test_selector_events.py that checks for the _accept_connection for-loop continuing through aborted connections instead of returning early. The test passes with this PR's changes 😄

@kumaraditya303 kumaraditya303 enabled auto-merge (squash) January 3, 2025 10:11
@kumaraditya303 kumaraditya303 merged commit 830e106 into python:main Jan 3, 2025
44 checks passed
@jb2170 jb2170 deleted the gh-127529 branch January 3, 2025 20:17
WolframAlph pushed a commit to WolframAlph/cpython that referenced this pull request Jan 4, 2025
…handling `ConnectionAbortedError` (python#127532)

Co-authored-by: Kumar Aditya <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…handling `ConnectionAbortedError` (python#127532)

Co-authored-by: Kumar Aditya <[email protected]>
@ambv
Copy link
Contributor

ambv commented May 21, 2025

@kumaraditya303 don't we want to backport this to 3.13? WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asyncio's BaseSelectorEventLoop._accept_connection returns when it should continue on ConnectionAbortedError

3 participants