Merge pull request #178 from overleaf/jpa-ignore-broken-socket-errors

[app] ignore errors from accessing disconnected client sockets
This commit is contained in:
Jakob Ackermann 2020-08-17 12:55:29 +02:00 committed by GitHub
commit 3505fae253

View file

@ -181,7 +181,11 @@ if (Settings.shutdownDrainTimeWindow) {
if (Settings.errors && Settings.errors.catchUncaughtErrors) { if (Settings.errors && Settings.errors.catchUncaughtErrors) {
process.removeAllListeners('uncaughtException') process.removeAllListeners('uncaughtException')
process.on('uncaughtException', function (error) { 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 }) Metrics.inc('disconnected_write', 1, { status: error.code })
return logger.warn( return logger.warn(
{ err: error }, { err: error },