Skip to content

Commit 3ff0010

Browse files
committed
aws: add a 10s response timeout to http client
Fixes #10051 Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
1 parent 070e761 commit 3ff0010

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/aws/flb_aws_util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#define AWS_USER_AGENT_K8S "k8s"
4747
#define AWS_ECS_METADATA_URI "ECS_CONTAINER_METADATA_URI_V4"
4848
#define FLB_MAX_AWS_RESP_BUFFER_SIZE 0 /* 0 means unlimited capacity as per requirement */
49+
#define FLB_MAX_AWS_RESP_TIMEOUT 10 /* 10 seconds */
4950

5051
#ifdef FLB_SYSTEM_WINDOWS
5152
#define FLB_AWS_BASE_USER_AGENT "aws-fluent-bit-plugin-windows"
@@ -386,6 +387,9 @@ struct flb_http_client *request_do(struct flb_aws_client *aws_client,
386387
goto error;
387388
}
388389

390+
/* Set a HTTP response timeout */
391+
flb_http_set_response_timeout(c, FLB_MAX_AWS_RESP_TIMEOUT);
392+
389393
/* Increase the maximum HTTP response buffer size to fit large responses from AWS services */
390394
ret = flb_http_buffer_size(c, FLB_MAX_AWS_RESP_BUFFER_SIZE);
391395
if (ret != 0) {

0 commit comments

Comments
 (0)