Add http.payloadTimeout config option (#177309)

## Summary

Fix https://github.com/elastic/kibana/issues/177138

- Add a `http.payloadTimeout` configuration option, to control the
payload timeout
- Set the default value for this option to `20s` (was `10s` previously)
This commit is contained in:
Pierre Gayvallet 2024-02-22 12:33:49 +01:00 committed by GitHub
parent 9a473879af
commit 38a3b9675d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 46 additions and 2 deletions

View file

@ -30,6 +30,9 @@ export const httpConfigSchema = schema.object(
socketTimeout: schema.number({
defaultValue: 120000,
}),
payloadTimeout: schema.number({
defaultValue: 20000,
}),
cors: schema.object({
enabled: schema.boolean({ defaultValue: false }),
allowCredentials: schema.boolean({ defaultValue: false }),
@ -53,6 +56,7 @@ export class HttpConfig implements IHttpConfig {
shutdownTimeout: Duration;
keepaliveTimeout: number;
socketTimeout: number;
payloadTimeout: number;
cors: ICorsConfig;
ssl: ISslConfig;
restrictInternalApis: boolean;
@ -64,6 +68,7 @@ export class HttpConfig implements IHttpConfig {
this.maxPayload = rawConfig.maxPayload;
this.shutdownTimeout = rawConfig.shutdownTimeout;
this.keepaliveTimeout = rawConfig.keepaliveTimeout;
this.payloadTimeout = rawConfig.payloadTimeout;
this.socketTimeout = rawConfig.socketTimeout;
this.cors = rawConfig.cors;
this.ssl = new SslConfig(rawConfig.ssl);

View file

@ -39,6 +39,7 @@ describe('BasePathProxyServer', () => {
shutdownTimeout: moment.duration(30, 'seconds'),
keepaliveTimeout: 1000,
socketTimeout: 1000,
payloadTimeout: 1000,
cors: {
enabled: false,
allowCredentials: false,