-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Enable HTTP debugging for AWS client requests #11015
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
base: master
Are you sure you want to change the base?
Changes from 5 commits
3863eea
7ac03a2
62f98ed
e27feac
909b105
4daa282
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -268,6 +268,12 @@ struct flb_aws_client *flb_aws_client_create() | |
| client->client_vtable = &client_vtable; | ||
| client->retry_requests = FLB_FALSE; | ||
| client->debug_only = FLB_FALSE; | ||
| client->http_cb_ctx = flb_callback_create("aws client"); // FIXME: what name? | ||
runderwo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (!client->http_cb_ctx) { | ||
| flb_errno(); | ||
| flb_free(client); | ||
| return NULL; | ||
| } | ||
| return client; | ||
| } | ||
|
|
||
|
|
@@ -291,6 +297,7 @@ void flb_aws_client_destroy(struct flb_aws_client *aws_client) | |
| if (aws_client->extra_user_agent) { | ||
| flb_sds_destroy(aws_client->extra_user_agent); | ||
| } | ||
| flb_callback_destroy(aws_client->http_cb_ctx); | ||
runderwo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| flb_free(aws_client); | ||
|
Comment on lines
297
to
301
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When tearing down an AWS client the code now calls Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @runderwo We need to wrap up with existence checking due to there's a possibility to be absent for registering aws_client->http_cb_ctx callbacks. This is because this type of register couldn't be caught up on dry_run or unit testing. So, we need to use a guard like a pessimistic way. |
||
| } | ||
| } | ||
|
|
@@ -386,6 +393,8 @@ struct flb_http_client *request_do(struct flb_aws_client *aws_client, | |
| goto error; | ||
| } | ||
|
|
||
| c->cb_ctx = aws_client->http_cb_ctx; | ||
|
|
||
| /* Increase the maximum HTTP response buffer size to fit large responses from AWS services */ | ||
| ret = flb_http_buffer_size(c, FLB_MAX_AWS_RESP_BUFFER_SIZE); | ||
| if (ret != 0) { | ||
|
|
||
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.
flb_http_client_debug_setup is not always existing in Fluent Bit core.
This is because only if enabled for -DFLB_HTTP_CLIENT_DEBUG=ON on configure.
So, we need to wrap up with
here.