[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-19 Thread Марк Коренберг

Марк Коренберг  added the comment:

Note, TCP_NODELAY can not be set on UNIX streaming socket. Do you have 
corresponding tests for UNIX sockets ?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-19 Thread STINNER Victor

STINNER Victor  added the comment:

Yury: thanks for fixing socket.socket.type. asyncio code now looks simpler and 
easier to follow without the helper functions just to test the socket type for 
equality.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-19 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset a7bd64c0c01379e9b82e86ad41a301329a0775d9 by Yury Selivanov in 
branch 'master':
bpo-27456: Simplify sock type checks (#4922)
https://github.com/python/cpython/commit/a7bd64c0c01379e9b82e86ad41a301329a0775d9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-18 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +4817

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 572636d42566da8eb6e85d5b8164e9ed8860a255 by Yury Selivanov in 
branch '3.6':
bpo-27456: Ensure TCP_NODELAY is set on linux (#4231) (#4898)
https://github.com/python/cpython/commit/572636d42566da8eb6e85d5b8164e9ed8860a255


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +4792

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +4791

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset e796b2fe26f220107ac50667de6cc86c82b465e3 by Yury Selivanov in 
branch 'master':
bpo-27456: Ensure TCP_NODELAY is set on linux (#4231)
https://github.com/python/cpython/commit/e796b2fe26f220107ac50667de6cc86c82b465e3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-11-02 Thread STINNER Victor

STINNER Victor  added the comment:

_ipaddr_info() also uses "type == socket.SOCK_STREAM". Is it ok?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-11-02 Thread STINNER Victor

STINNER Victor  added the comment:

> sock.type == socket.SOCK_STREAM

Oh, right. I wrote PR 4233 to fix the code.

Yury: "Good catch.  I made a PR to fix this."

Oops. If you wrote a PR, would it mind to compare it with mine, please?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-11-02 Thread STINNER Victor

Change by STINNER Victor :


--
keywords: +patch
pull_requests: +4201

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-11-02 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Seems like this fix is incomplete. It contains this check:
>
>sock.type == socket.SOCK_STREAM
>
> But sock.type is not only a type 

Good catch.  I made a PR to fix this.

--
resolution: fixed -> 
stage: resolved -> patch review
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-11-02 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +4200

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-11-02 Thread Vladimir Magamedov

Vladimir Magamedov  added the comment:

Seems like this fix is incomplete. It contains this check:

sock.type == socket.SOCK_STREAM

But sock.type is not only a type (at least in Linux and FreeBSD), it also may 
contain SOCK_NONBLOCK and SOCK_CLOEXEC flags. So I'm hitting the same problem: 
on the Linux in asyncio I have:

> sock.type == socket.SOCK_STREAM | socket.SOCK_NONBLOCK == 2049
True

So this check isn't working and TCP_NODELAY still disabled by default.

Links:
- http://man7.org/linux/man-pages/man2/socket.2.html
- https://github.com/torvalds/linux/blob/v4.13/include/linux/net.h#L77
- https://github.com/freebsd/freebsd/blob/stable/11/sys/sys/socket.h#L110

Linux has SOCK_TYPE_MASK definition equal to 0xf, but I can't find such 
definition in the FreeBSD sources. And I don't know how to reliably and with 
forward compatibility check sock.type without calling getsockopt() syscall.

Currently I have a fix in my project, where:

_sock_type_mask = 0xf if hasattr(socket, 'SOCK_NONBLOCK') else 0x

And then in my own _set_nodelay(sock) function:

sock.type & _sock_type_mask == socket.SOCK_STREAM

Should I make a pull request or someone knows more reliable check? Or it is ok 
to add one more syscall?

sock.getsockopt(socket.SOL_SOCKET, socket.SO_TYPE) == socket.SOCK_STREAM

--
nosy: +vmagamedov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2016-09-11 Thread Yury Selivanov

Yury Selivanov added the comment:

Committed, should be in 3.6 b1.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2016-09-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f7e4ae9eba3 by Yury Selivanov in branch '3.5':
Issue #27456: asyncio: Set TCP_NODELAY by default.
https://hg.python.org/cpython/rev/3f7e4ae9eba3

New changeset 10384c5c18f5 by Yury Selivanov in branch 'default':
Merge 3.5 (issue #27456)
https://hg.python.org/cpython/rev/10384c5c18f5

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2016-09-02 Thread Марк Коренберг

Марк Коренберг added the comment:

vote +10 for that

--
nosy: +mmarkk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27456] asyncio: set TCP_NODELAY flag by default

2016-09-02 Thread STINNER Victor

Changes by STINNER Victor :


--
title: TCP_NODELAY -> asyncio: set TCP_NODELAY flag by default

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com