Skip to content

Conversation

@asvetlov
Copy link
Contributor

@asvetlov asvetlov commented Dec 3, 2018

Restore a consitensy with selector based event loops.
TCP_NODELAY is enabled starting from Python 3.6

https://bugs.python.org/issue35380

Copy link
Member

@1st1 1st1 left a 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'):
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asvetlov
Copy link
Contributor Author

asvetlov commented Dec 3, 2018

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.

@1st1
Copy link
Member

1st1 commented Dec 3, 2018

Without backport third parties like aiohttp should check for event loop type and enable the mode for proactor only, which looks very odd.

SGTM

@asvetlov asvetlov merged commit 3bc0eba into python:master Dec 3, 2018
@miss-islington
Copy link
Contributor

Thanks @asvetlov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

@bedevere-bot
Copy link

@asvetlov: Please replace # with GH- in the commit message next time. Thanks!

@asvetlov asvetlov deleted the tcp-nodelay-windows branch December 3, 2018 19:08
@bedevere-bot
Copy link

GH-10872 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 3, 2018
@miss-islington
Copy link
Contributor

Sorry, @asvetlov, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 3bc0ebab17bf5a2c29d2214743c82034f82e6573 3.6

@bedevere-bot
Copy link

GH-10874 is a backport of this pull request to the 3.6 branch.

asvetlov added a commit to asvetlov/cpython that referenced this pull request Dec 3, 2018
asvetlov added a commit that referenced this pull request Dec 3, 2018
GH-10872)

* bpo-35380: Enable TCP_NODELAY for proactor event loop (GH-10867)
(cherry picked from commit 3bc0eba)

Co-authored-by: Andrew Svetlov <[email protected]>
asvetlov added a commit that referenced this pull request Dec 5, 2018
…. (GH-10874)

* [3.6] bpo-35380: Enable TCP_NODELAY for proactor event loop (GH-10867).
(cherry picked from commit 3bc0eba)

Co-authored-by: Andrew Svetlov <[email protected]>
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.

5 participants