filter_kubernetes: Plug SEGV occurence on enabling Use_Pod_Association#12153
filter_kubernetes: Plug SEGV occurence on enabling Use_Pod_Association#12153cosmo0920 wants to merge 3 commits into
Conversation
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Kubernetes filter moves AWS pod-to-service association synchronization into each filter context, adds shutdown-aware timed refreshes, and joins workers during exit. A runtime test now exercises two pod-association filter instances sharing a cache directory. ChangesPod association worker lifecycle
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant FilterInit
participant PodServiceWorker
participant PodServiceMap
participant FilterExit
FilterInit->>PodServiceWorker: create worker with filter context
PodServiceWorker->>PodServiceMap: fetch pod-service map
PodServiceWorker->>PodServiceWorker: wait on refresh condition
FilterExit->>PodServiceWorker: signal shutdown
PodServiceWorker-->>FilterExit: join worker
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/filter_kubernetes/kubernetes.c`:
- Around line 281-294: Update the mutex and condition initialization failure
paths in the filter initialization function to call flb_kube_conf_destroy(ctx)
before returning -1, matching the existing regex-init cleanup path; retain mutex
destruction before cleanup on condition initialization failure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1c125796-822c-4277-afb2-a440d9191399
⛔ Files ignored due to path filters (1)
tests/runtime/data/kubernetes/pod-service.mapis excluded by!**/*.map
📒 Files selected for processing (3)
plugins/filter_kubernetes/kube_conf.hplugins/filter_kubernetes/kubernetes.ctests/runtime/filter_kubernetes.c
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
The Kubernetes filter now:
flb_time_get()for portable refresh deadlines in kubernetes.c.This prevents two instances from sharing an overwritten context and concurrently destroying the same TLS state.
Verification:
ctest --test-dir build -R '^flb-rt-filter_kubernetes$' --output-on-failure: passed in 119.90 seconds.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