mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Resolve intermittent premature connection closed (#19808)
Node 8 changed the keepAlive to default to 5 seconds from 5 minutes. This reverts that behavior. Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
parent
dd9e095f19
commit
83dd263048
1 changed files with 8 additions and 1 deletions
|
@ -47,7 +47,11 @@ export function setupConnection(server, config) {
|
|||
|
||||
// not using https? well that's easy!
|
||||
if (!useSsl) {
|
||||
server.connection(connectionOptions);
|
||||
const connection = server.connection(connectionOptions);
|
||||
|
||||
// revert to previous 5m keepalive timeout in Node < 8
|
||||
connection.listener.keepAliveTimeout = 120e3;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -66,6 +70,9 @@ export function setupConnection(server, config) {
|
|||
}
|
||||
});
|
||||
|
||||
// revert to previous 5m keepalive timeout in Node < 8
|
||||
connection.listener.keepAliveTimeout = 120e3;
|
||||
|
||||
const badRequestResponse = new Buffer('HTTP/1.1 400 Bad Request\r\n\r\n', 'ascii');
|
||||
connection.listener.on('clientError', (err, socket) => {
|
||||
if (socket.writable) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue