filter_kubernetes: don't recycle connections in fetch_pod_service_map#11600
filter_kubernetes: don't recycle connections in fetch_pod_service_map#11600
Conversation
- mark connections as non-recyclable before releasing to free TLS resources - connections are destroyed instead of pooled since polling runs every 60s anyway fixes #11523 Signed-off-by: Cameron Sparr <sparrc@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified the Kubernetes AWS filter's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8a6bee052
ℹ️ 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".
| /* Cleanup */ | ||
| /* Cleanup - mark connection as non-recyclable to prevent memory leak */ | ||
| flb_http_client_destroy(c); | ||
| flb_upstream_conn_recycle(u_conn, FLB_FALSE); |
There was a problem hiding this comment.
Keep successful pod-association fetches recyclable
When the pod-association endpoint rotates its mTLS certs, this line forces the very next refresh to open a new TLS session with the old in-memory ctx->aws_pod_association_tls object. That TLS context is only rebuilt in flb_kube_pod_association_init() (plugins/filter_kubernetes/kube_meta.c:2020-2045), and the surrounding comment in fetch_pod_service_map() (plugins/filter_kubernetes/kubernetes_aws.c:214-218) explicitly relies on reusing the existing connection until a failure triggers that rebuild. With recycle forced off after every 200 response, the first post-rotation refresh will fail and the pod/service map stays stale until the next refresh interval recreates the upstream.
Useful? React with 👍 / 👎.
fixes #11523
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