From a0028646a5a9140c25c4abfcfc4d3d54f2992cb5 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 12 Aug 2020 11:45:36 +0100 Subject: [PATCH] [app] ignore errors from accessing disconnected client sockets Technically `EHOSTUNREACH` and `ETIMEDOUT` should go into a 'disconnected_read' metric. But this would require changes to dashboards and a larger diff. --- services/real-time/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/real-time/app.js b/services/real-time/app.js index c41743e597..fa6c5f7563 100644 --- a/services/real-time/app.js +++ b/services/real-time/app.js @@ -181,7 +181,11 @@ if (Settings.shutdownDrainTimeWindow) { if (Settings.errors && Settings.errors.catchUncaughtErrors) { process.removeAllListeners('uncaughtException') process.on('uncaughtException', function (error) { - if (['EPIPE', 'ECONNRESET'].includes(error.code)) { + if ( + ['ETIMEDOUT', 'EHOSTUNREACH', 'EPIPE', 'ECONNRESET'].includes( + error.code + ) + ) { Metrics.inc('disconnected_write', 1, { status: error.code }) return logger.warn( { err: error },