Skip to content
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

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

bazzargh
Copy link
Contributor

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:

  • [N/A ] Example configuration file for the change
  • [N/A ] Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A ] Documentation required for this feature

Backporting

  • Backport to latest stable release.

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.

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]>
@@ -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;
Copy link
Collaborator

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bazzargh ping

Copy link
Contributor Author

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]>
@edsiper edsiper merged commit a162864 into fluent:master Nov 9, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants