-
Notifications
You must be signed in to change notification settings - Fork 79
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
Don't mute/discard connection when "quick listener check" fails #6
Comments
The "problem" is in https://github.com/alexcesaro/statsd/blob/master/conn.go#L50. But after reading the code, the only thing I came up is to remove this code block. :| Because then it works as ... I need it to. :) It seems gdiazlo@d12d68c did the same. |
Commit removes "quick listener check" which mutes connection and returns error when listener isn't available at the time of inicialization. It seems as this there is no need to scrap connection, because when remote endpoint comes around later, metrics will be received by that endpoint just fine. Fixes alexcesaro#6
@zstyblik's fork seems good. @alexcesaro is there a great reason to keep that check in there? Would you be willing to accept a PR where that check is optional? |
Please refer to https://github.com/gdiazlo/statsd as a solution to this issue in the original repo alexcesaro#6. This will add the functionality needed while keeping the additional changes that are currently present in this fork. It is useful to have this change as the metrics within a service *shouldn't* stop a service from operating. Currently, it works as is but as soon as `.Clone` is called on the client, it crashes due to a nil conn (caused by this check).
This implementation does not provide connection state management. Handling connection failures and retrying as necessary should be implemented by the caller, if desired.
(fix 2/2 for alexcesaro#6) Adds an option to facilitate initialising an unmuted client for UDP conns where the server is unreachable.
Very old issue, but I've been doing some work on my fork. As I understand it, muting the client returned by Ignoring the initial check is still a valid use case, though, so I've made two changes:
|
Hello,
I'm wondering whether it would be possible to try to either connect(un-mute) or from time to time.
Currently, when:
Then no attempt is made to connect again. I don't want to fail application just because connection cannot be established, although may be I should. Also, it seems to me a bit cumbersome to introduce some check-whether-StatsD-is-initialized logic.
Would it be possible to try to connect from time to time eg. on flush() or just from time to time and un-mute?
If I kill listener, then connection is re-established once listener comes back. However, if listener isn't there when StatsD client is initialized, we never try again.
Thanks,
Z.
The text was updated successfully, but these errors were encountered: