-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-35380: Enable TCP_NODELAY for proactor event loop #10867
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
Conversation
1st1
left a comment
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.
I'm a bit cautious (i.e. I'm +0) with backporting this to 3.7. Are you sure it's 100% safe?
| futures._get_loop(fut).stop() | ||
|
|
||
|
|
||
| if hasattr(socket, 'TCP_NODELAY'): |
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.
I'd add a new asyncio.sockutils module for this kind of stuff.
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.
sockutils.py sounds great but in the case I doubt if the PR can be backported.
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.
Indeed, I suggest to do that in a follow up PR specifically for the master branch.
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.
Created https://bugs.python.org/issue35392 for it.
|
Yes, the change is safe: Windows supports TCP_NODELAY very well for any version, at least I used it on Win 2000 and XP. Without backport third parties like aiohttp should check for event loop type and enable the mode for proactor only, which looks very odd. |
SGTM |
|
Thanks @asvetlov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
|
@asvetlov: Please replace |
|
GH-10872 is a backport of this pull request to the 3.7 branch. |
(cherry picked from commit 3bc0eba) Co-authored-by: Andrew Svetlov <[email protected]>
|
Sorry, @asvetlov, I could not cleanly backport this to |
|
GH-10874 is a backport of this pull request to the 3.6 branch. |
…-10867). (cherry picked from commit 3bc0eba) Co-authored-by: Andrew Svetlov <[email protected]>
Restore a consitensy with selector based event loops.
TCP_NODELAY is enabled starting from Python 3.6
https://bugs.python.org/issue35380