Skip to content

Reuse Netty request-context attributes between requests - #12584

Open
amarziali wants to merge 1 commit into
masterfrom
andrea.marziali/netty-reuse-request-attributes
Open

amarziali wants to merge 1 commit into
masterfrom
andrea.marziali/netty-reuse-request-attributes

Conversation

@amarziali

Copy link
Copy Markdown
Contributor

What Does This Do

Clear HTTP request-context attribute values instead of removing their containers. This avoids recreating attributes and updating Netty’s attribute map on subsequent keep-alive requests.

Adjust HTTP/2 context transfer to ignore empty retained parent attributes while preserving existing child contexts. Channel-close cleanup remains unchanged.

JMH results for the two attribute lifecycles used per request:

Netty Other attributes Before → after, ns/op Before → after, B/op
4.1.112 3 46.8 → 9.8 176 → ~0
4.1.112 11 65.8 → 12.9 304 → ~0
4.1.47 3 24.1 → 12.8 80 → ~0
4.1.47 11 30.2 → 15.9 80 → ~0

Measured using real EmbeddedChannel attributes, 32 rotating context values, JMH 1.37, Temurin 17.0.18, and Apple M4 Max. Three forks, three 1-second warmup iterations, four 1-second measurement iterations, one thread, a 512 MiB heap, and the GC profiler. Timing confidence intervals do not overlap.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@amarziali amarziali added type: feature Enhancements and improvements tag: performance Performance related changes labels Sep 21, 2026
@amarziali
amarziali requested a review from a team as a code owner September 21, 2026 10:10
@amarziali amarziali added the inst: netty Netty instrumentation label Sep 21, 2026
@amarziali
amarziali requested review from ygree and removed request for a team September 21, 2026 10:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T10:13:00.423663Z c5c7b38 PR opened
🔒 Security Review Completed 2026-09-21T10:14:43.143318Z c5c7b38 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-official datadog-official Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

More details

The change preserves request-context lifecycle behavior while it reuses Netty attribute containers. The static reviewer found no reportable defect in request reuse or HTTP/2 context transfer.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit c5c7b38 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@datadog-official

datadog-official Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 59.09% (-0.04%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c5c7b38 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.68 s 14.70 s [-0.9%; +0.6%] (no difference)
startup:insecure-bank:tracing:Agent 13.59 s 13.63 s [-1.2%; +0.6%] (no difference)
startup:petclinic:appsec:Agent 17.08 s 16.82 s [+0.6%; +2.5%] (maybe worse)
startup:petclinic:iast:Agent 16.95 s 17.05 s [-1.4%; +0.2%] (no difference)
startup:petclinic:profiling:Agent 16.78 s 16.93 s [-2.1%; +0.2%] (no difference)
startup:petclinic:sca:Agent 17.01 s 16.70 s [+1.1%; +2.7%] (significantly worse)
startup:petclinic:tracing:Agent 15.66 s 16.22 s [-7.6%; +0.8%] (no difference)

Commit: c5c7b38d · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: netty Netty instrumentation tag: performance Performance related changes type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant