You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
loop.create_unix_server() should remove socket at that path if it exists. Every application that wants to use unix socket server should do that. Why not to add code that removes unix socket before binding ?
It should:
Check if it is exists and that is UNIX socket (i.e. do os.stat())
raise exception if removal failed, raise exception if this path exists but is not unix socket.
not even try to remove if path starts with zero byte (i.e. abstract unix socket)
What if you are trying, by mistake, to start a second instance of a server, with the previous one still running? We want to catch that mistake, instead of silently removing the existing socket.
All software that I see unlinks stale socket unconditionally. Can you show any one that checks for the other instance ? Also, seems the kernel checks if address already in use during bind() even when FS node is removed.
Although there is another approach: maybe the correct thing to do is to remove the socket file after we close the unix server? How Twisted/Tornado implement this?
Activity
gjcarneiro commentedon Sep 22, 2016
What if you are trying, by mistake, to start a second instance of a server, with the previous one still running? We want to catch that mistake, instead of silently removing the existing socket.
socketpair commentedon Sep 22, 2016
All software that I see unlinks stale socket unconditionally. Can you show any one that checks for the other instance ? Also, seems the kernel checks if address already in use during
bind()even when FS node is removed.1st1 commentedon Oct 5, 2016
+1 one to do this. @socketpair can you quickly make a PR (so that we can fix this before 3.6b2)?
1st1 commentedon Oct 5, 2016
Although there is another approach: maybe the correct thing to do is to remove the socket file after we close the unix server? How Twisted/Tornado implement this?
ZhukovAlexander commentedon Oct 6, 2016
@1st1 both Twisted and Tornado clean stale sockets before binding:
socketpair commentedon Oct 6, 2016
@1st1 @ZhukovAlexander @gjcarneiro please review
Clean up stale Unix domain socket paths from the file system before a…