Skip to content

Commit

Permalink
out_s3: support auto_retry_requests for failed connections
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Fala <[email protected]>
  • Loading branch information
matthewfala authored and PettitWesley committed Sep 7, 2021
1 parent f39d970 commit 39a38a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/out_s3/s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ static int cb_s3_init(struct flb_output_instance *ins,
ctx->s3_client->flags = 0;
ctx->s3_client->proxy = NULL;
ctx->s3_client->s3_mode = S3_MODE_SIGNED_PAYLOAD;
ctx->s3_client->retry_requests = ctx->retry_requests;

ctx->s3_client->upstream = flb_upstream_create(config, ctx->endpoint, 443,
FLB_IO_TLS, ctx->client_tls);
Expand Down Expand Up @@ -2286,6 +2287,16 @@ static struct flb_config_map config_map[] = {
"the documentation."
},

{
FLB_CONFIG_MAP_BOOL, "auto_retry_requests", "false",
0, FLB_TRUE, offsetof(struct flb_s3, retry_requests),
"Immediately retry failed requests to AWS services once. This option "
"does not affect the normal Fluent Bit retry mechanism with backoff. "
"Instead, it enables an immediate retry with no delay for networking "
"errors, which may help improve throughput when there are transient/random "
"networking issues."
},

{
FLB_CONFIG_MAP_BOOL, "use_put_object", "false",
0, FLB_TRUE, offsetof(struct flb_s3, use_put_object),
Expand Down
1 change: 1 addition & 0 deletions plugins/out_s3/s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ struct flb_s3 {
char *content_type;
char *log_key;
int free_endpoint;
int retry_requests;
int use_put_object;
int send_content_md5;
int static_file_path;
Expand Down

0 comments on commit 39a38a3

Please sign in to comment.