Skip to content

Commit

Permalink
remove headers timeout hack, rely on nodejs timeouts (#83419)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov authored Nov 17, 2020
1 parent 95ff10b commit 48231c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/core/server/http/http_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions test/server_integration/http/platform/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down Expand Up @@ -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();
});
Expand Down

0 comments on commit 48231c8

Please sign in to comment.