in_tail: Serialize DB operation for preventing resource collisions on threaded mode - #11460
Conversation
📝 WalkthroughWalkthroughAdds DB lock/unlock helpers and wraps tail plugin database operations (open, file set, offset, rotate, delete, stale-file delete) with explicit locking and unlock-on-error; updates Changes
Sequence Diagram(s)sequenceDiagram
participant Tail as Tail Worker
participant Lock as DB Lock (tail_db_lock / tail_db_unlock)
participant DB as SQLite DB
Tail->>Lock: request lock (tail_db_lock)
Lock-->>Tail: lock acquired
Tail->>DB: perform DB operation (open/set/offset/rotate/delete)
DB-->>Tail: operation result (ok / error)
Tail->>Lock: release lock (tail_db_unlock)
Lock-->>Tail: lock released
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
c2e82e0 to
eeba913
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2e82e062c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Closes #11357.
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:
On another terminal before launching fluent-bit:
after fluent-bit launched:
There's no duplicated lines:
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