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

in_tail: signal pending only once #9054

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

linxiulei
Copy link

Prior to this commit, if the tail is watching over multiple files, each file signals pending and results in calling in_tail_collect_pending() multiple times. Since function in_tail_collect_pending() goes through all watched files for pending data so calling it once is sufficient.

This commit changes that by only signal pending event when there is any pending data from any watched files.

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

  • [N/A] 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.

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

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] 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.

@linxiulei
Copy link
Author

@edsiper could you please have a review again? Thanks!

@leonardo-albertovich
Copy link
Collaborator

If I'm correct you'd also have to add a check here to ensure that even if there's an error checking a file the signal is sent, otherwise you might lose the "scheduled" signal in some corner cases.

Other than that it looks good to me.

@linxiulei
Copy link
Author

If I'm correct you'd also have to add a check here to ensure that even if there's an error checking a file the signal is sent, otherwise you might lose the "scheduled" signal in some corner cases.

Other than that it looks good to me.

Just to clarify, this is a bug not brought in by this PR, right?

@leonardo-albertovich
Copy link
Collaborator

No, with the previous approach each time the function detected that it the signal needed to be sent it was immediately sent which means if it were iterating 100 files and the 50th caused it to abort through the codepath I linked it would've sent the signal before whereas with the new (and proper) approach it wouldn't because it just sets a flag that's checked only in the "everything went well" code path.

@linxiulei linxiulei force-pushed the tail_signal_pending branch from cc1411e to f2eeada Compare August 1, 2024 13:02
@linxiulei
Copy link
Author

Right, thanks very much for detailed explanation. Changed, PTAL!

@leonardo-albertovich leonardo-albertovich added this to the Fluent Bit v3.1.5 milestone Aug 1, 2024
@edsiper
Copy link
Member

edsiper commented Aug 6, 2024

@lecaros I remember like a year ago you did an extensive test on this area, wondering if you can run those tests again ?

@edsiper edsiper added this to the Fluent Bit v3.1.6 milestone Aug 8, 2024
@edsiper
Copy link
Member

edsiper commented Aug 8, 2024

Moving to next milestone to run extensive workload testing

@linxiulei
Copy link
Author

Is there anything to fix for Pull requests compile checks / pr-compile-centos-7 (pull_request) Failing after 1m

@edsiper
Copy link
Member

edsiper commented Aug 27, 2024

@lecaros any help is appreciated

@lecaros
Copy link
Contributor

lecaros commented Aug 27, 2024

FYI: Tests look good. I want to give it another fresh run tomorrow, tho.

@lecaros
Copy link
Contributor

lecaros commented Aug 29, 2024

I did a few long runs in k8s as well. No issues. Thanks for allowing testing this before merging.

@linxiulei
Copy link
Author

@edsiper can this PR be merged for next release?

@linxiulei
Copy link
Author

@edsiper can you approve and merge this PR? Thanks!

@linxiulei
Copy link
Author

@edsiper is this PR ready to be merged?

@leonardo-albertovich
Copy link
Collaborator

@edsiper please merge this PR, it's ready and delaying it will cause issues.

Prior to this commit, if the tail is watching over multiple files, each
file signals pending and results in calling in_tail_collect_pending()
multiple times. Since function in_tail_collect_pending() goes through
all watched files for pending data so calling it once is sufficient.

This commit changes that by only signal pending event when there is any
pending data from any watched files.

Signed-off-by: Eric Lin <[email protected]>
@linxiulei linxiulei force-pushed the tail_signal_pending branch from f2eeada to 961e908 Compare January 4, 2025 22:23
@linxiulei
Copy link
Author

Rebased and bump for merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants