Prevent Netty idle timers from retaining request context - #12503
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
The new matcher limits propagation suppression to IdleStateHandler.initialize(ChannelHandlerContext). The shared advice restores the prior propagation state on normal and exceptional exits.
🤖 Datadog Autotest · Commit 5a02f2b · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
|
🎯 Code Coverage (details) 🔗 Commit SHA: 33cc72c | Docs | View more details | Give us feedback! |
🟢 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. |
5a02f2b to
33cc72c
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
Prevent Netty idle timers from retaining request context Co-authored-by: andrea.marziali <andrea.marziali@datadoghq.com>
What Does This Do
Prevents Netty’s channel-owned idle timers from capturing the request context active during channel initialization.
IdleStateHandler.initialize()creates recurring timeout tasks. When initialization happens during the first Vert.x request, those tasks can inherit its context even though their lifecycle belongs to the channeland continues until channel teardown.
The existing async-propagation suppression instrumentation now disables propagation only while these timers are created, restoring the previous state on normal and exceptional exits.
sequenceDiagram participant Request as First client request participant Handler as Netty IdleStateHandler participant Agent as Context instrumentation participant Timer as Channel idle timer participant Channel Request->>Handler: initialize(channel context) Handler->>Agent: enter initialize() Agent->>Agent: save propagation state Agent->>Agent: disable async propagation Handler->>Timer: create recurring timeout task Note over Timer: Channel-owned task<br/>No request context captured Handler-->>Agent: exit initialize() Agent->>Agent: restore propagation state Handler-->>Request: continue request Timer->>Channel: monitor idle state until teardownMotivation
The idle timer belongs to the channel rather than to the request that happens to initialize it. Capturing that request’s context retains its continuation beyond request completion and can delay trace publication.
Suppressing capture at the timer-creation boundary preserves normal propagation for Vert.x callbacks, errors, cancellation and request processing.
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 issueJira ticket: [PROJ-IDENT]