Skip to content

Commit

Permalink
input: Config parsing order fixed for FS storage pause parameter (#8720)
Browse files Browse the repository at this point in the history
This commit fixes a dependency issue for the
storage.pause_on_chunks_overlimit parameter.
In case the order in the config file was
  storage.pause_on_chunks_overlimit On
  storage.type Filesystem
then the storage.pause_on_chunks_overlimit was ignored.

This commit changes this behavior, so that the
storage.pause_on_chunks_overlimit parameter will be parsed and set.
It will be reset in case the storage.type is set to a different type
than FS later.

Signed-off-by: Richard Treu <[email protected]>
  • Loading branch information
drbugfinder-work authored Jul 12, 2024
1 parent bf8c9a2 commit 88545a0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/flb_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,15 @@ int flb_input_set_property(struct flb_input_instance *ins,
flb_sds_destroy(tmp);
return -1;
}

if (ins->storage_type != FLB_STORAGE_FS &&
ins->storage_pause_on_chunks_overlimit == FLB_TRUE) {
flb_debug("[input] storage.pause_on_chunks_overlimit will be "
"reset because storage.type is not filesystem");
ins->storage_pause_on_chunks_overlimit = FLB_FALSE;
}
flb_sds_destroy(tmp);

}
else if (prop_key_check("threaded", k, len) == 0 && tmp) {
enabled = flb_utils_bool(tmp);
Expand All @@ -609,14 +617,12 @@ int flb_input_set_property(struct flb_input_instance *ins,
ins->is_threaded = enabled;
}
else if (prop_key_check("storage.pause_on_chunks_overlimit", k, len) == 0 && tmp) {
if (ins->storage_type == FLB_STORAGE_FS) {
ret = flb_utils_bool(tmp);
flb_sds_destroy(tmp);
if (ret == -1) {
return -1;
}
ins->storage_pause_on_chunks_overlimit = ret;
ret = flb_utils_bool(tmp);
flb_sds_destroy(tmp);
if (ret == -1) {
return -1;
}
ins->storage_pause_on_chunks_overlimit = ret;
}
else {
/*
Expand Down

0 comments on commit 88545a0

Please sign in to comment.