-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-93821: Handle connection resets on Windows #124779
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
cf9aa61
c41f32a
ae9e545
1de9339
af5f035
dd70293
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||
| Fix error handling in windows events where clients terminating connections could result in an asyncio server using Proactor event loops to hang indefinitely. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. About NEWS format please to reading this: https://devguide.python.org/documentation/markup/
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there something I need to change, or is the comment informational?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, sorry. I meant that your NEWS format seems incorrect. Maybe you should check out the NEWS written by others in the Misc section, that might be better. Edit: For the module, you should use the example I provided.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. think this is what they meant:
Suggested change
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it! Thanks for clarification. |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppressing
CancelledErroris a huge red flag and should only be done in desperate times. Can you write an elaborate comment what's going on here? I don't understand whyCancelledErrorneeds suppressing neither from this comment nor from the PR description.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is supposed to be:
https://github.com/python/cpython/pull/124032/files#diff-15176d64608861034db7168743f4f116f4cb33422cf685a2b911481c55826aa2R861-R862
We have reproduced this: the regular uvicorn+fastapi server receives a connection from a process that is forcefully terminated afterward.
What
_loopneeds to do: determine if an error =OSError: [WinError 64] The specified network name is no longer available; in that case, it should just run the next iteration of the loop.Our working fix looks like that: https://gist.github.com/cybergrind/9cbbdc94503548d74dc4d5d3ed99248c