This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vaizki
Recipients aeros, asvetlov, dacut, gvanrossum, njs, vaizki, yselivanov
Date 2019-11-20.12:18:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574252296.28.0.0872376390017.issue37228@roundup.psfhosted.org>
In-reply-to
Content
Going to SO_REUSEPORT will fix the security issue and emitting a deprecation warning for default value invocation will catch the eyes of some maintainers but it will not prevent what caused me to catch this issue in the first place - starting two processes (with same UID) accidentally listening on the same UDP port (in my case it was port 5060 as a default SIP port).

Since there already is a reuse_port parameter to create_datagram_endpoint(), I assume the proposal is to set default value for reuse_addresss=False and reuse_port=True? But if reuse_address is explicitly set to True, are we going to just set SO_REUSEPORT instead and always leave SO_REUSEADDR unset? This would leave the reuse_address parameter completely useless and still allow accidental port reuse.

What if I really do want SO_REUSEADDR? Ok I can create a socket separately, call setsockopt() on it and pass it as the sock parameter to create_datagram_endpoint(). 

Maybe I'm not fully grasping the proposal.. or maybe we should just deprecate reuse_port from both create_datagram_endpoint() and create_server() + reuse_addr from create_datagram_endpoint()? 

This would leave the TCP create_server() with the reuse_addr parameter, defaulting reasonably to True. To use TCP/UDP SO_REUSEPORT or UDP SO_REUSEADDR, the docs would tell you to bake your own socket with socket.socket(). Those few (like me) who really need the functionality can survive without all-in-one convenience functions on asyncio.loop
History
Date User Action Args
2019-11-20 12:18:16vaizkisetrecipients: + vaizki, gvanrossum, njs, asvetlov, yselivanov, dacut, aeros
2019-11-20 12:18:16vaizkisetmessageid: <1574252296.28.0.0872376390017.issue37228@roundup.psfhosted.org>
2019-11-20 12:18:16vaizkilinkissue37228 messages
2019-11-20 12:18:15vaizkicreate