remove headers timeout hack, rely on nodejs timeouts (#83419)
This commit is contained in:
parent
95ff10b47a
commit
48231c8400
|
@ -103,10 +103,6 @@ interface ListenerOptions {
|
||||||
export function createServer(serverOptions: ServerOptions, listenerOptions: ListenerOptions) {
|
export function createServer(serverOptions: ServerOptions, listenerOptions: ListenerOptions) {
|
||||||
const server = new Server(serverOptions);
|
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.keepAliveTimeout = listenerOptions.keepaliveTimeout;
|
||||||
server.listener.setTimeout(listenerOptions.socketTimeout);
|
server.listener.setTimeout(listenerOptions.socketTimeout);
|
||||||
server.listener.on('timeout', (socket) => {
|
server.listener.on('timeout', (socket) => {
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default function ({ getService }: FtrProviderContext) {
|
||||||
const config = getService('config');
|
const config = getService('config');
|
||||||
|
|
||||||
describe('headers timeout ', () => {
|
describe('headers timeout ', () => {
|
||||||
it('issue-73849', async () => {
|
it('handles correctly. See issue #73849', async () => {
|
||||||
const agent = new Http.Agent({
|
const agent = new Http.Agent({
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
});
|
});
|
||||||
|
@ -74,7 +74,7 @@ export default function ({ getService }: FtrProviderContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
await performRequest();
|
await performRequest();
|
||||||
const defaultHeadersTimeout = 40 * oneSec;
|
const defaultHeadersTimeout = 60 * oneSec;
|
||||||
await delay(defaultHeadersTimeout + oneSec);
|
await delay(defaultHeadersTimeout + oneSec);
|
||||||
await performRequest();
|
await performRequest();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue