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
Allow 0 as Retry_Limit to disable retrying #3219
Conversation
Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
src/flb_output.c
Outdated
else { | ||
ins->retry_limit = 0; | ||
ins->retry_limit = FLB_OUT_RETRY_NONE; | ||
} |
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.
What user input leads to this else case being run? I'm trying to follow the logic and I don't get it..
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.
We can set via command line. -p "Retry_Limit="
e.g. $ ../bin/fluent-bit -i dummy -o es -p "Retry_Limit=" --sosreport
Without this patch, if we set retry_limit=0, fluent-bit will retry again and again.
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.
(By the way, I think this value should be 1 (=default value) at this else case.)
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.
(By the way, I think this value should be 1 (=default value) at this else case.)
I agree
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.
Thank you.
I've pushed a commit to set default value 1.
Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
@edsiper Can we merge this? |
@nokute78 Can you cherry-pick these commits onto the 1.7 branch so that we can get this change released in the next 1.7 patch release? |
@PettitWesley No I can't. |
@nokute78 Yes you can! Lol I just meant open a pull request against the 1.7 branch. I can merge it for you. I can't do releases either but if we merge it then it will go out in the next release. |
@PettitWesley Sure. |
can we use some words instead of numbers as the suggested values ?, e.g:
if we set "0" from a reading perspective might mean "there is no limit", so I propose the following values and behaviors:
my concern is the user readability of the expected behavior more than the technical implementation. @PettitWesley comments? |
@edsiper Thank you for comment. I agree. I want to wait @PettitWesley 's comment. Or another way is to create new option. Fluentd supports so many configuration parameters for retrying. Currently |
I would avoid adding more options if the original configuration property can handle all situations |
this PR is on hold until the logic of the PR is changed as suggested on #3219 (comment) |
@niedbalski can you check pls why the message check is failing? |
https://github.com/fluent/fluent-bit/blob/master/.github/workflows/check-commit.yaml#L17 $ irb
irb(main):001:0> str = "output: define unlimited/none retry configurtion constant"
irb(main):002:0> p str.match /^[a-z\-_]+\:[ ]{0,1}[a-z]+[a-zA-Z0-9 \-\.\:_]+$/
nil
=> nil
irb(main):003:0> p str.match /^[a-z\-_]+\:[ ]{0,1}[a-z]+[a-zA-Z0-9 \/\-\.\:_]+$/
#<MatchData "output: define unlimited/none retry configurtion constant">
=> #<MatchData "output: define unlimited/none retry configurtion constant"> |
Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
I updated this PR to follow #3219 (comment) |
@PettitWesley Would you comment about #3219 (comment) ? |
I agree with Eduardo's reasoning, and his proposal. I'd use |
@PettitWesley Thank you for comment. @edsiper Can we merge this ?
irb(main):001:0> str = 'output: define unlimited/none retry configurtion constan
t'
irb(main):002:0> str.match /^[a-z0-9A-Z\-_\s\,\.\/]+\:[ ]{0,1}[a-zA-Z]+[a-zA-Z0-
9 \-\.\:_\#\(\)=\/\'\"\,><\+\[\]\!\*\\]+$/
=> #<MatchData "output: define unlimited/none retry configurtion constant"> |
@nokute78 we are good to go, please just do the minor changes to pass the CI |
@edsiper CI status is #3219 (comment) There are two errors, but one is not related this PR and the other should be fixed by latest regex pattern. ====
irb(main):001:0> str = 'output: define unlimited/none retry configurtion constan
t'
irb(main):002:0> str.match /^[a-z0-9A-Z\-_\s\,\.\/]+\:[ ]{0,1}[a-zA-Z]+[a-zA-Z0-
9 \-\.\:_\#\(\)=\/\'\"\,><\+\[\]\!\*\\]+$/
=> #<MatchData "output: define unlimited/none retry configurtion constant"> |
Note: Commit message regex pattern is not updated by re-run CI job. |
However previous step @niedbalski |
Only |
Looks like the check wasn't run on your latest commits: https://github.com/fluent/fluent-bit/pull/3219/checks?check_run_id=2311012858 |
@PettitWesley Thank you for comment. I tested by hand and it was success #3219 (comment) |
|
@PettitWesley I think so. @edsiper @agup006 @niedbalski What should I do? |
Merged for now, @niedbalski maybe we need the Commit message check to rerun on fix? |
I removed draft status from document repo. @agup006 @niedbalski Thank you. FYI: CI was succeeded when it was merged master. |
* output: define unlimited/none retry configurtion constant Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * engine: support no retry configuration(fluent#3190) Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * sosreport: use FLB_OUT_RETRY_UNLIMITED define Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * output: set default value when invalid retry_limit is set Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * output: support no_retries/no_limits as retry_limits value Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
* output: define unlimited/none retry configurtion constant Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * engine: support no retry configuration(fluent#3190) Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * sosreport: use FLB_OUT_RETRY_UNLIMITED define Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * output: set default value when invalid retry_limit is set Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * output: support no_retries/no_limits as retry_limits value Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
* output: define unlimited/none retry configurtion constant Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * engine: support no retry configuration(fluent#3190) Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * sosreport: use FLB_OUT_RETRY_UNLIMITED define Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * output: set default value when invalid retry_limit is set Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * output: support no_retries/no_limits as retry_limits value Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
* output: define unlimited/none retry configurtion constant Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * engine: support no retry configuration(#3190) Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * sosreport: use FLB_OUT_RETRY_UNLIMITED define Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * output: set default value when invalid retry_limit is set Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * output: support no_retries/no_limits as retry_limits value Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
* output: define unlimited/none retry configurtion constant * engine: support no retry configuration(#3190) * sosreport: use FLB_OUT_RETRY_UNLIMITED define * output: set default value when invalid retry_limit is set * output: support no_retries/no_limits as retry_limits value Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
Fixes #3190
This PR allows
Retry_Limit 0
and it disables retrying.Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Documentation
Example Configuration
Debug output
Stop Elasticsearch before testing.
Valgrind output
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.