From 37a64162fac93def9e3c583ef21162d900f5a026 Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Tue, 17 Nov 2020 14:28:41 +0300 Subject: [PATCH] remove headers timeout hack, rely on nodejs timeouts (#83419) --- src/core/server/http/http_tools.ts | 4 ---- test/server_integration/http/platform/headers.ts | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/server/http/http_tools.ts b/src/core/server/http/http_tools.ts index 14adbced95c7a..1e69669e080ec 100644 --- a/src/core/server/http/http_tools.ts +++ b/src/core/server/http/http_tools.ts @@ -103,10 +103,6 @@ interface ListenerOptions { export function createServer(serverOptions: ServerOptions, listenerOptions: ListenerOptions) { const server = new Server(serverOptions); - // remove fix + test as soon as update node.js to v12.19 https://github.com/elastic/kibana/pull/61587 - server.listener.headersTimeout = - listenerOptions.keepaliveTimeout + 2 * server.listener.headersTimeout; - server.listener.keepAliveTimeout = listenerOptions.keepaliveTimeout; server.listener.setTimeout(listenerOptions.socketTimeout); server.listener.on('timeout', (socket) => { diff --git a/test/server_integration/http/platform/headers.ts b/test/server_integration/http/platform/headers.ts index 260bc37bd1328..50cfa5c702231 100644 --- a/test/server_integration/http/platform/headers.ts +++ b/test/server_integration/http/platform/headers.ts @@ -31,7 +31,7 @@ export default function ({ getService }: FtrProviderContext) { const config = getService('config'); describe('headers timeout ', () => { - it('issue-73849', async () => { + it('handles correctly. See issue #73849', async () => { const agent = new Http.Agent({ keepAlive: true, }); @@ -74,7 +74,7 @@ export default function ({ getService }: FtrProviderContext) { } await performRequest(); - const defaultHeadersTimeout = 40 * oneSec; + const defaultHeadersTimeout = 60 * oneSec; await delay(defaultHeadersTimeout + oneSec); await performRequest(); });