in_tail: Add error log when flb fails to update the DB. Currently it fails silently.#11417
in_tail: Add error log when flb fails to update the DB. Currently it fails silently.#11417hardikkhurana wants to merge 2 commits intofluent:masterfrom
Conversation
📝 WalkthroughWalkthroughAdds an error log in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff5d8bfbcc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@plugins/in_tail/tail_db.c`:
- Around line 301-304: The flb_plg_error call in tail_db.c is broken by an
unterminated format string and misplaced quotes; fix the call in the error
branch where ctx->stmt_offset is handled by replacing the broken literal with a
single properly formatted format string and moving the variables into the
argument list (e.g. "db: cannot update file offset for %s (id=%" PRIu64 "),
ret=%d" , file->name, file->db_id, ret). Ensure the format uses the PRIu64 macro
concatenation exactly as above, remove the stray quote, and keep the subsequent
sqlite3_clear_bindings(ctx->stmt_offset) call unchanged.
… it fails silently. Signed-off-by: Hardik Khurana <43683221+hardikkhurana@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Hardik Khurana <43683221+hardikkhurana@users.noreply.github.com>
Fixes #11416
Description:
When using the in_tail plugin with a database configured (db parameter), if the SQLite database becomes locked (e.g., receives SQLITE_BUSY or SQLITE_LOCKED), the plugin silently fails to update the file offset. The function flb_tail_db_file_offset returns -1, but no error message is logged to indicate that the persistence failed.
Change:
Add an error log line so that the error is not silent.
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