Kaynağa Gözat

Handle ECONNRESET in the same way as EPIPE

Simon Detheridge 6 yıl önce
ebeveyn
işleme
8e45a62e32
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      services/real-time/app.coffee

+ 2 - 1
services/real-time/app.coffee

@@ -141,7 +141,8 @@ if Settings.shutdownDrainTimeWindow?
 	if Settings.errors?.catchUncaughtErrors
 		process.removeAllListeners('uncaughtException')
 		process.on 'uncaughtException', (error) ->
-			if error.code == 'EPIPE'
+			if ['EPIPE', 'ECONNRESET'].includes(error.code)
+				Metrics.inc('disconnected_write')
 				return logger.warn err: error, 'attempted to write to disconnected client'
 			logger.error err: error, 'uncaught exception'
 			if Settings.errors?.shutdownOnUncaughtError