Skip to content

Commit d212965

Browse files
singholtThean Lim
authored andcommitted
output: add retry_limit_is_set flag
Add a boolean to flb_output_instance that tracks whether retry_limit was explicitly set by the user. This allows plugins to distinguish between the engine default and an explicit user configuration. Co-authored-by: Thean Lim <theanlim@amazon.com> Signed-off-by: Anuj Singh <singholt@amazon.com>
1 parent 3ed4782 commit d212965

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

include/fluent-bit/flb_output.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ struct flb_output_instance {
355355

356356
/* Plugin properties */
357357
int retry_limit; /* max of retries allowed */
358+
int retry_limit_is_set; /* explicitly set by user? */
358359
int use_tls; /* bool, try to use TLS for I/O */
359360
char *match; /* match rule for tag/routing */
360361
#ifdef FLB_HAVE_REGEX

src/flb_output.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ struct flb_output_instance *flb_output_new(struct flb_config *config,
778778
instance->match_regex = NULL;
779779
#endif
780780
instance->retry_limit = 1;
781+
instance->retry_limit_is_set = FLB_FALSE;
781782
instance->host.name = NULL;
782783
instance->host.address = NULL;
783784
instance->net_config_map = NULL;
@@ -940,6 +941,7 @@ int flb_output_set_property(struct flb_output_instance *ins,
940941
flb_sds_destroy(tmp);
941942
}
942943
else if (prop_key_check("retry_limit", k, len) == 0) {
944+
ins->retry_limit_is_set = FLB_TRUE;
943945
if (tmp) {
944946
if (strcasecmp(tmp, "no_limits") == 0 ||
945947
strcasecmp(tmp, "false") == 0 ||

0 commit comments

Comments
 (0)