From 39a38a3c81339bc93c262a18ab334d126642d7fc Mon Sep 17 00:00:00 2001 From: Matthew Fala Date: Wed, 1 Sep 2021 15:53:53 -0700 Subject: [PATCH] out_s3: support auto_retry_requests for failed connections Signed-off-by: Matthew Fala --- plugins/out_s3/s3.c | 11 +++++++++++ plugins/out_s3/s3.h | 1 + 2 files changed, 12 insertions(+) diff --git a/plugins/out_s3/s3.c b/plugins/out_s3/s3.c index 4a3779b7109..31d0a107c63 100644 --- a/plugins/out_s3/s3.c +++ b/plugins/out_s3/s3.c @@ -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); @@ -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), diff --git a/plugins/out_s3/s3.h b/plugins/out_s3/s3.h index 67081144bb1..47a8eed1157 100644 --- a/plugins/out_s3/s3.h +++ b/plugins/out_s3/s3.h @@ -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;