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

using SO_REUSEADDR with udp socket has odd behaviour #130

Open
luca3m opened this issue May 14, 2015 · 2 comments
Open

using SO_REUSEADDR with udp socket has odd behaviour #130

luca3m opened this issue May 14, 2015 · 2 comments

Comments

@luca3m
Copy link
Contributor

luca3m commented May 14, 2015

Statsite uses SO_REUSEADDR option on UDP socket. This causes that if there is another UDP server bind to that port, statsite will take its place, receiving all packets. It's not so polite and an expected behaviour I think.

I tested this issue on Linux, on Mac OS does not happen. To replicate this issue disable tcp listen, open a statsite instance and then another one, you will see al metrics going to the new one.

@armon
Copy link
Collaborator

armon commented Jul 6, 2015

@luca3m This is to allow a rapid restart of statsite on the TCP port, it's probably fine to remove this for UDP.

@drawks
Copy link
Contributor

drawks commented May 8, 2017

If this setting is changed it should wait until the next major release, since it has definite behavioral differences which are different across different platforms and the existing behavior is one that /could/ be useful for some people in doing "zero-downtime" style deploys. Where starting a new instance will pickup the data stream before the old instance is shutdown.

FWIW the specific effects of the SO_REUSEADDR socket option has varied in the recent past of the linux kernel AND is different on BSD and perhaps other platforms.

I think this issue should just be closed and if someone cares to do a PR which changes the socket options we can have a debate as to the merit of the change there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants