Skip to content

Reuse Netty request-context attributes between requests - #12584

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
andrea.marziali/netty-reuse-request-attributes
Sep 23, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits 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

This comment has been minimized.

@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.86 s 14.79 s [-0.5%; +1.4%] (no difference)
startup:insecure-bank:tracing:Agent 13.64 s 13.70 s [-1.4%; +0.5%] (no difference)
startup:petclinic:appsec:Agent 17.10 s 16.88 s [+0.4%; +2.2%] (maybe worse)
startup:petclinic:iast:Agent 17.02 s 17.00 s [-0.6%; +0.9%] (no difference)
startup:petclinic:profiling:Agent 16.74 s 16.93 s [-2.2%; -0.1%] (maybe better)
startup:petclinic:sca:Agent 17.03 s 16.76 s [+0.6%; +2.7%] (maybe worse)
startup:petclinic:tracing:Agent 16.10 s 16.13 s [-1.2%; +0.8%] (no difference)

Commit: eb7603ff · 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.

@amarziali
amarziali requested a review from a team as a code owner September 22, 2026 07:23
@amarziali
amarziali requested review from sarahchen6 and removed request for a team September 22, 2026 07:23

@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.

Bits Code Review: PASS

More details

Empty parent attributes do not replace child HTTP/2 contexts. Channel-close cleanup still removes all attributes.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 18198b0 · @DataDog review to ask questions

@sarahchen6 sarahchen6 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.

Cool 👍

@ygree ygree 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.

IDM approved. Left a coupe of notes.

@amarziali
amarziali enabled auto-merge September 23, 2026 07:38
@amarziali
amarziali added this pull request to the merge queue Sep 23, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-23 08:26:24 UTC ℹ️ Start processing command /merge


2026-09-23 08:26:28 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-09-23 09:28:47 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 23, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 7dbe57e into master Sep 23, 2026
606 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/netty-reuse-request-attributes branch September 23, 2026 09:28
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 23, 2026
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.

3 participants