Closed t83714 closed 8 months ago
Update: socket hang up error are ingored.
But ERR_HTTP_HEADERS_SENT
error will cause restarts:
_http_outgoing.js:561
throw new ERR_HTTP_HEADERS_SENT('set');
^
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at new NodeError (internal/errors.js:322:7)
at ServerResponse.setHeader (_http_outgoing.js:561:11)
at setHeadersFromObject (/usr/src/app/node_modules/on-headers/index.js:94:16)
at ServerResponse.setWriteHeadHeaders (/usr/src/app/node_modules/on-headers/index.js:122:5)
at ServerResponse.writeHead (/usr/src/app/node_modules/on-headers/index.js:30:36)
at ProxyServer.<anonymous> (/usr/src/app/component/dist/createBaseProxy.js:88:9)
at ProxyServer.emit (/usr/src/app/node_modules/eventemitter3/index.js:210:27)
at ClientRequest.proxyError (/usr/src/app/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:165:18)
at ClientRequest.emit (events.js:400:28)
at Socket.socketErrorListener (_http_client.js:475:9) {
code: 'ERR_HTTP_HEADERS_SENT'
}
closed via PR: https://github.com/magda-io/magda/pull/3497
Investigate whether gateway will restart for losing connection of proxy target
We saw some errors like:
in Magda gateway logs.
We need to make sure those errors are ignored rather than causing restarts