connections: downstream: harden listener and architecture [Backport to 4.2] - #12054
connections: downstream: harden listener and architecture [Backport to 4.2]#12054cosmo0920 wants to merge 2 commits into
Conversation
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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: 00eadc57f4
ℹ️ 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".
| if (connection->drop_notification_callback != NULL) { | ||
| connection->drop_notification_callback(connection); | ||
| } |
There was a problem hiding this comment.
Wire the drop callback for downstream owners
This call does not currently notify any owner because the new field is never assigned anywhere in the tree (rg "drop_notification_callback\\s*=" finds no setters). In the HTTP server path, sessions still retain session->connection/connection->user_data when the connection is attached (src/http_server/flb_http_server.c:275-281), and later unconditionally release that pointer during session destroy (src/http_server/flb_http_server.c:512-513); if flb_downstream_conn_timeouts() drops the downstream connection first (src/flb_downstream.c:515-516), the session is left with a stale connection pointer. Please register the callback where downstream sessions are attached, or the added notification mechanism will not prevent the timeout/use-after-free case it is meant to handle.
Useful? React with 👍 / 👎.
This PR is only backporting connections and downstream hardening from #11742 due to plugging lack of notification mechanism for a deletion of connections.
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.