-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: ARES_OPT_TRIES must be set to update opt.tries #8587
Conversation
This is a typo I spotted in reviewing fluent#5613 - the current code appears to set opt.tries to 2 (from the default 3) but because the corresponding optflag is not set it will be ignored. See the c-ares code that is being called: https://github.com/c-ares/c-ares/blob/e4a4346596c62621704371270220b567b0ddd83d/src/lib/ares_options.c#L310-L316 Signed-off-by: bazzargh <[email protected]>
src/flb_network.c
Outdated
@@ -1000,7 +1000,7 @@ static struct flb_dns_lookup_context *flb_net_dns_lookup_context_create( | |||
* the number of retries to 2 | |||
*/ | |||
|
|||
optmask = ARES_OPT_FLAGS; | |||
optmask = ARES_OPT_FLAGS | ARES_OPT_TRIES; |
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.
Could you please remove the flag and the following line?
After some consideration I remembered that due to a design constraint fluent-bit won't allow c-ares to retry so we'll have to wait until that is worked on before we can enable retries.
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.
@bazzargh ping
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.
Sorry I just got back from a holiday watching the eclipse! Updated as requested.
following comments in the PR, the preferred option is to remove the ineffective retries option and the mask that would have caused it to have any effect. The resulting code should behave exactly as before, since the mask was required for the original retries option to work, and it has never been set; so no additonal tests are supplied. Signed-off-by: bazzargh <[email protected]>
This is a typo I spotted in reviewing #5613 - the current code appears to set opt.tries to 2 (from the default 3) but because the corresponding optflag is not set it will be ignored.
See the c-ares code that is being called:
https://github.com/c-ares/c-ares/blob/e4a4346596c62621704371270220b567b0ddd83d/src/lib/ares_options.c#L310-L316
I'm afraid this is a bit thrown over the wall and untested - I'm just doing it to highlight what's clearly a bug in the code.
An alternative approach would be to delete the line setting opt.tries, because that would leave the behaviour unchanged;
right now I'd want the change I'm proposing tested, because that tries setting has never worked before.
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:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
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.