Remove Unix Socket on close
- Dominant language
- Rust
- Stars
- 5.1k
- Forks
- 329
- PR merge metrics
- No merged PRs in 30d
Description
@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.
Contributor guide
Assessment
This issue has not been assessed yet.