David Cuthbert <da...@kanga.org> added the comment:

On the completely deprecate reuse_address and rewrite/force folks to use 
reuse_port proposals, I'm a bit dubious of this approach.

Right now, we have two knobs that directly correspond to (potential) 
kernel-level socket parameters, SO_REUSEADDR and SO_REUSEPORT. We just chose an 
unfortunate default for one of them. Otherwise, the behavior is nicely explicit.

Rewriting or forbidding it, even when the user has (essentially) acknowledged 
they're accepting risks by passing reuse_address=True, seems to fly in the face 
of this. Users get bitten when we start convoluting logic here (I was just 
bitten by fcntl.lockf() not actually calling lockf() last month and ended up 
having to call lockf() via ctypes.).

There are some platforms (Linux pre-3.9 kernels) that don't have SO_REUSEPORT. 
I wish I could say I don't care about such platforms; alas, I just had to 
compile Python 3.7 on a system running a 2.6 kernel last month at a client site.

Finally, I've only scratched the surface with my test cases, on single-homed 
systems, IPv4, and binding to 0.0.0.0. There are a lot of parameters to try 
here before we decree that reuse_address has no purpose existing, and an OS 
could later reimplement saner defaults on SO_REUSEADDR.

Changing a default already has some controversy (Yury was -1 on this change). 
This seems much bigger and I'm not convinced we fully understand its 
ramifications.

That said, I'll happily implement whatever the consensus ends up being, or 
consensus as designated by the vBDFL, or wherever that decision needs to come 
from. :-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37228>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to