[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: Apologies for the delay here. I've pushed a documentation patch at https://github.com/python/cpython/pull/29760. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Jim Crist-Harif
Change by Jim Crist-Harif : -- keywords: +patch pull_requests: +27998 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29760 ___ Python tracker <https://bugs.python.org/issu

[issue45883] reuse_address mistakenly removed from loop.create_server

2021-11-23 Thread Jim Crist-Harif
Change by Jim Crist-Harif : -- keywords: +patch pull_requests: +27970 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29733 ___ Python tracker <https://bugs.python.org/issu

[issue45883] reuse_address mistakenly removed from loop.create_server

2021-11-23 Thread Jim Crist-Harif
New submission from Jim Crist-Harif : In https://bugs.python.org/issue45129 the deprecated `reuse_address` parameter to `create_datagram_endpoint` was removed. This PR mistakenly removed this parameter from `create_server` as well (where it wasn't deprecated). -- components: asyncio

[issue45819] Avoid releasing the GIL in nonblocking socket operations

2021-11-16 Thread Jim Crist-Harif
Change by Jim Crist-Harif : -- components: +asyncio -C API nosy: +asvetlov, yselivanov ___ Python tracker <https://bugs.python.org/issue45819> ___ ___ Python-bug

[issue45819] Avoid releasing the GIL in nonblocking socket operations

2021-11-16 Thread Jim Crist-Harif
Change by Jim Crist-Harif : -- keywords: +patch pull_requests: +27822 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29579 ___ Python tracker <https://bugs.python.org/issu

[issue45819] Avoid releasing the GIL in nonblocking socket operations

2021-11-16 Thread Jim Crist-Harif
New submission from Jim Crist-Harif : In https://bugs.python.org/issue7946 an issue with how the current GIL interacts with mixing IO and CPU bound work. Quoting this issue: > when an I/O bound thread executes an I/O call, > it always releases the GIL. Since the GIL is released, a CPU

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: > Is tornado the only example or you are aware of other libraries with such > behavior? A quick survey of other language network stacks didn't turn anything up, *But* I also didn't find any implementations (other than asyncio & tornado) that bind

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: If you decline that a change is needed here, at the very least the current behavior of `port=0` should be documented. I'd be happy to push up a fix if so. -- ___ Python tracker <https://bugs.python.

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: > I'm not aware of an OS API call that binds both IPv4 and IPv6 to the same > random port. Sure, but `loop.create_server` is already higher-level than a single OS API call. By default `create_server` will already bind multiple sockets if

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: Hmmm, I'd find that situation a bit surprising, but I suppose it could happen. Looks like tornado just errors, and that seems to work fine for them in practice (https://github.com/tornadoweb/tornado/blob/790715ae0f0a30b9ee830bfee75bb7fa4c4ec2f6/tornado

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: > Is there an OS interface to ensure the same port on both stacks? I don't think this is needed? Right now the code processes as: - Expand host + port + family + flags into a list of one or more tuples of socket options (https://github.com/python/cpyt

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Jim Crist-Harif
Change by Jim Crist-Harif : -- versions: +Python 3.10, Python 3.8 ___ Python tracker <https://bugs.python.org/issue45693> ___ ___ Python-bugs-list mailin

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Jim Crist-Harif
New submission from Jim Crist-Harif : To create a new server with `loop.create_server` that listens on all interfaces and a random port, I'd expect passing in `host=""`, `port=0` to work (per the documentation). However, as written this results in 2 different ports being used - on