Unhandled WS error crashes program when stream endpoint becomes unreachable
Closed this issue · 5 comments
mitom commented
When using the Signalflow part of this library, when the endpoint becomes unreachable (network outage or similar) it will crash the application due to an unhandled error:
Error: getaddrinfo ENOTFOUND stream.eu0.signalfx.com stream.eu0.signalfx.com:443
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
The source of the error is https://github.com/signalfx/signalfx-nodejs/blob/master/lib/client/signalflow/request_manager.js#L154-L160 there is no error handler being set on the WS connection.
To reproduce:
- Start a signalflow computation via websockets
- Disconnect from internet
- wait approx 20 seconds
Expected:
The error would be propagated up to the top level in some way so the application using this library can decide what to do with it.
mpetazzoni commented
Thanks for the report!
mstumpfx commented
I'll pull this into our internal bug fix system and get it prioritized.