Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Unix Socket on close #669

Open
yoshuawuyts opened this issue Jul 31, 2020 · 3 comments
Open

Remove Unix Socket on close #669

yoshuawuyts opened this issue Jul 31, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@yoshuawuyts
Copy link
Member

@timsuchanek reported an issue with Tide's unix:// handler where on close the socket is kept open on disk. This caused issues when closing and then restarting a server over UDS.

We should ensure that when a Tide server is closed we close the UDS socket too. If need be we can do this synchronously on Drop.

Open question: graceful termination

Something I do wonder though is what happens to any open clients on the other side of the socket when we remove it from the filesystem. I would imagine they just get an error on the next system call since the fd no longer exists? The alternative is that they time out since the server is no longer active and responding.

Probably the right solution in the future is to enable graceful termination of connections so that we can send a signal to the application, and then stop accepting new connections before the application exits. We should also enable this on async drop when it lands; but that may be further out.

@yoshuawuyts yoshuawuyts added the bug Something isn't working label Jul 31, 2020
@Fishrock123
Copy link
Member

Related to #528 "Graceful shutdown"

@rtyler
Copy link
Contributor

rtyler commented Oct 25, 2020

My workaround for this has been to simply run std::fs::remove_file("my.sock"); before starting the listener.

IMHO that may be something worth incorporating into the listener itself 🤷‍♀️

@jcbritobr
Copy link

My workaround for this has been to simply run std::fs::remove_file("my.sock"); before starting the listener.

IMHO that may be something worth incorporating into the listener itself 🤷‍♀️

Or at least trigger an error saying that file already exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants