Avoid reactor netty continuation leakage#11559
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 480f2c0d1e
ℹ️ 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".
| // Avoid leaking continuations on the netty event loop that initiates the tasks that handle the | ||
| // request lifecycle | ||
| transformer.applyAdvice( | ||
| named("subscribe").and(isDeclaredBy(REACTOR_NETTY_HTTP_CONNECT)), advice); |
There was a problem hiding this comment.
Preserve connect error propagation under the barrier
For Reactor Netty requests that fail during TCP connect before doOnRequest/the HTTP write runs (for example a refused or unroutable endpoint), this disables async propagation for the whole MonoHttpConnect.subscribe call, so Netty's ConnectAdvice sees captureActiveSpan() as noop and never stores CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; ChannelFutureListenerInstrumentation then returns when that continuation is missing and skips the netty.connect error span. TransferConnectSpan only runs once a request exists, so it cannot restore the parent for these connect-failure paths.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Well to be fair the testConnectionFailure looks disabled today, sign that it looks uncovered/not working. I'll try to do an effort to see if it's somehow feaseable
This comment has been minimized.
This comment has been minimized.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
480f2c0 to
c57ea0d
Compare
What Does This Do
This PR fixes some scope propagation leakage happening on netty-reactor. This also impacts the spring-webflux client since it's based on this last one.
A couple of different fixes:
Please note that removeStrictTraces has been successfully removed from the concerned tests that are now passing OK (without this PR they are timing out as expected)
Note: Perhaps a broader re-evaluation of reactor context propagation is needed to avoid doing defensive fixes like this one
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)Jira ticket: [PROJ-IDENT]