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

Periodic reconnect to avoid stale UDP connections #51

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Jonnymcc
Copy link

@Jonnymcc Jonnymcc commented Mar 26, 2018

What?
Allows the client to periodically reconnect to the server.

client := NewStatsdClient(udpAddr.String(), prefix)
client.reconnect = true

Why?
We are using this library within Kubernetes and when our statsd servers get recreated (within Kubernetes) a connection to an old service endpoint results in metrics being emitted via UDP and going nowhere. We believe this is due to conntrack keeping the route open because there is at least one client that is connected to it (the app that implements this library).

@Jonnymcc Jonnymcc closed this Mar 26, 2018
@Jonnymcc Jonnymcc reopened this Apr 4, 2018
@Jonnymcc Jonnymcc force-pushed the periodic-reonnect branch from d2d0c87 to 3a46488 Compare April 4, 2018 15:13
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

Successfully merging this pull request may close these issues.

1 participant