-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flb_aws_util: set max response buffer size for the http client #4047
Conversation
545cf8a
to
f973484
Compare
Squash commits and check DCO |
83e8a15
to
40e235d
Compare
Signed-off-by: Rayhan Hossain <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
40e235d
to
0786d96
Compare
src/aws/flb_aws_util.c
Outdated
@@ -309,6 +310,11 @@ struct flb_http_client *request_do(struct flb_aws_client *aws_client, | |||
goto error; | |||
} | |||
|
|||
/* Increase the maximum HTTP response buffer size to fit large responses from AWS services */ | |||
if (flb_http_buffer_size(c, FLB_MAX_AWS_RESP_BUFFER_SIZE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there are two problems here:
- this function returns -1 when it fails and that actually evaluates to true IIRC
- also, fluent bit code style says you can't call a function inside an if condition
So you need to do:
ret = flb_http_buffer_size(c, FLB_MAX_AWS_RESP_BUFFER_SIZE);
if (ret == -1) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ret != 0
instead of ret == -1
Signed-off-by: Rayhan Hossain <[email protected]>
* flb_aws_util: set max response buffer size for the http client Signed-off-by: Rayhan Hossain <[email protected]>
) * flb_aws_util: set max response buffer size for the http client Signed-off-by: Rayhan Hossain <[email protected]>
) * flb_aws_util: set max response buffer size for the http client Signed-off-by: Rayhan Hossain <[email protected]>
This change will enable unlimited response buffer for aws http client. In this way we can mitigate the following error for all AWS plugins including kinesis_firehose and s3.
[ warn] [http_client] cannot increase buffer: current=4096 requested=36864 max=4096
Testing
Before we can approve your change; please submit the following in a comment:
Documentation
Debug log for this change
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.