mitsuhiko / systemfd

Development helper utility for helping with auto reloading for projects supporting systemd socket activation
Apache License 2.0
497 stars 18 forks source link

"Address already in use" when restarting #6

Closed joprice closed 1 month ago

joprice commented 5 years ago

After the first run, I see the error:

error: EADDRINUSE: Address already in use

Seems like the process isn't releasing the port on shutdown? Is this something I'm doing wrong? I'm using the command:

systemfd --no-pid -s http::8082 -- cargo watch -x run

ricochet1k commented 5 years ago

This can be fixed by patching systemfd to set SO_REUSEADDR and SO_REUSEPORT.

joprice commented 5 years ago

That makes sense.

As a sidenote, after leaving that comment and debugging further, I realized that I had configured https://github.com/mozilla/sccache. I tried disabling it, and find that I now only get into this situation when my process panics.

arkN7 commented 4 years ago

Same thing here..

rattrayalex commented 3 years ago

Is there a workaround to this that doesn't involve patching the crate?

mitsuhiko commented 1 month ago

This has been changed for a while, since the latest release also on windows. Reusing can be disabled by passing --no-reuse.