-
Notifications
You must be signed in to change notification settings - Fork 135
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
Fix uds reconnection logic #188
Fix uds reconnection logic #188
Conversation
@prognant Thank you, well that explains why there were issues here! Two things to note on this:
|
@bdeitte This PR fixes 1 of the 4 issues I mentioned in #128 (comment) and is a good start. It could also be done (as a quick hack) by just swapping Unfortunately a UDS failure with I actually initially had used |
Hi @dhermes & @bdeitte, thanks for your prompt replies. The PR #189 seems to be a better fit overall. BTW the So I'll close this one and add my thoughts, if any, on the other PR ! Thanks a lot ! |
@prognant You made some remarks about Windows. Have you done any testing / confirmed how UDS failures look on Windows? |
Thanks @prognant for taking a look here and your thoughts! |
Hi @dhermes, UDS support is fairly recent on Windows (https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/) and AFAIK datagram are not yet supported. The one thing that comes to my mind regarding Windows is DataDog/datadog-agent#5809 that leverages a Windows specific thing (windows named pipe) that behaves similarly to UDS. Node.js seems to natively support windows named pipe, but that would probably be a new Windows-only feature and the whole UDS thing is likely to remain a linux/bsd/mac thing. |
@prognant Awesome info, thanks for the explanation! |
Statsd UDS reconnection logic is not working because error code are checked against positive value : current codebase use the following positive
errno
: 111ECONNREFUSED
& 107ENOTCONN
.However node.js relies on libuv that uses negated errno :
This PR uses
util.getSystemErrorName
that was made available in node.js v9.7.0 and subsequently backported to v8.12.0Either it's acceptable to bump the node.js version requirements from "Node 8.x and higher" to "Node 8.12 and higher" or we can go back to the hardcoded number and just negate those (side notes: those codes does not exit on mac and are different on windows, -4053 and -4078 thus resolving to the text representation will be more platform agnostic) just let me know !