signalfx/signalfx-nodejs

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:

  1. Start a signalflow computation via websockets
  2. Disconnect from internet
  3. 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.

Thanks for the report!

I'll pull this into our internal bug fix system and get it prioritized.

Hi @mitom, want to take a look at #48 and see if it satisfies your use case?

mitom commented

@mstumpfx thanks for reaching out, there are a few other changes which seem to be irrelevant for this issue (assuming they are improvements) but the error handling part seems like it should fix this issue!

Cool - merged #48 so going to close this issue - Thanks again for the bug report.