-
Notifications
You must be signed in to change notification settings - Fork 1.9k
in_tail: permission error handling #10690
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughA new boolean configuration option, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TailPlugin
participant FileSystem
User->>TailPlugin: Start plugin with skip_permission_errors option
TailPlugin->>FileSystem: Perform glob scan (with GLOB_ERR)
FileSystem-->>TailPlugin: Permission error (GLOB_ABORTED)
alt skip_permission_errors enabled
TailPlugin->>TailPlugin: Log warning, retry glob scan (without GLOB_ERR)
FileSystem-->>TailPlugin: Return accessible files/directories
TailPlugin->>User: Continue processing
else skip_permission_errors disabled
TailPlugin->>User: Fail plugin initialization
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
3c8411f to
90999fb
Compare
|
Thanks @kyo-ke 🙌 — solid work on the glob fallback logic! The new skip_permission_errors option makes the tail input plugin far more resilient in real-world scenarios where permission inconsistencies are common (especially in multi-tenant environments or containerized workloads). We've tested the changes with a mix of readable and unreadable directories, and the plugin now gracefully logs warnings and continues scanning valid paths as expected. No memory leaks observed via Valgrind, and everything looks clean on our end. |
|
hmm the retry now runs only when skip_permission_errors is disabled. This is the opposite of the intended behaviour described in the new configuration option and struct comment, causing the plugin to keep running on permission errors when the feature is off and to abort when it is turned on. I think this has not been tested properly or I missed something... |
plugins/in_tail/tail_scan_glob.c
Outdated
| /* Scan the given path */ | ||
| /* Scan the given path with error checking enabled. */ | ||
| ret = do_glob(path, GLOB_TILDE | GLOB_ERR, NULL, &globbuf); | ||
| if (ret == GLOB_ABORTED && !ctx->skip_permission_errors) { |
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.
this conditional seems to be wrong
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 for reviewing this @edsiper .
Will add fix for this
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.
This has been fixed. @edsiper Please help review again!
Fix permission error retry behavior. Co-authored-by: Kyosuke Kariya <[email protected]> Signed-off-by: Sandy Chen <[email protected]>
abf9e20 to
2ab17f9
Compare
|
Please review again @edsiper . |
e09f752 to
83bbbfe
Compare
Signed-off-by: Sandy Chen <[email protected]>
83bbbfe to
61a058c
Compare
Changer glob logic for tail input plugin.
Currently if path wildcard matches directories which have insufficient permission, entire tail plugin will fail.
By this PR just show warn and keep reading from file with sufficient permission and just show warning.
#10656
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-testlabel 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.
Summary by CodeRabbit
New Features
Bug Fixes