-
-
Notifications
You must be signed in to change notification settings - Fork 178
unlink stale unix socket before binding #425
Comments
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 |
+1 one to do this. @socketpair can you quickly make a PR (so that we can fix this before 3.6b2)? |
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? |
@1st1 both Twisted and Tornado clean stale sockets before binding: |
@1st1 @ZhukovAlexander @gjcarneiro please review |
…ttempting bind. This is in case the event loop implementation does not already do this. See python/asyncio#425.
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:
os.stat()
)The text was updated successfully, but these errors were encountered: