Skip to content

Fix Jetty 9.0 continuation form-body test race - #12904

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
andrea.marziali/fix-jetty90-continuation-body-race
Oct 16, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
andrea.marziali/fix-jetty90-continuation-body-race

Conversation

@amarziali

@amarziali amarziali commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Avoid an intermittent ReadPendingException in the Jetty 9.0.0 continuation
test handler by parsing URL-encoded forms before suspending the request.

If parsing commits a blocking response, mark the request handled and return
without suspending or dispatching it.

Add a regression test that sends 100 form requests with HTTP connection
retries disabled. It verifies response status and body, one trace per
request, converted-body tags, and async dispatch spans.

Only test code changes; production instrumentation is unchanged.

Motivation

The shared HTTP test client sends Expect: 100-continue for requests with a
body. This asks the server to acknowledge the request before the client
sends the body.

When form parsing happens after a continuation resumes, the body read can
overlap with Jetty 9.0.0's pending connection read and cause
ReadPendingException. Parsing before suspension avoids this timing.

Additional Notes

The regression test retains the Expect: 100-continue handshake while
disabling connection retries, so retries cannot hide request failures.
It runs under both HTTP naming conventions.

NOTE: This is a workaround in the test handler, not a fix to Jetty itself.

@amarziali amarziali added the type: bug fix Bug fix label Oct 16, 2026
@amarziali
amarziali requested a review from a team as a code owner October 16, 2026 07:48
@amarziali amarziali added the tag: no release notes Changes to exclude from release notes label Oct 16, 2026
@amarziali
amarziali requested review from jordan-wong and removed request for a team October 16, 2026 07:48
@amarziali amarziali added tag: flaky test Flaky tests inst: jetty Jetty instrumentation labels Oct 16, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-10-16T07:52:33.744695Z e4fbbd7 PR opened
🔒 Security Review ✅ Completed 2026-10-16T07:51:25.331685Z e4fbbd7 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-datadog-prod-us1-2 datadog-datadog-prod-us1-2 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

The early form parsing and committed-response guard are consistent with the inherited continuation tests. The added regression coverage preserves Expect: 100-continue while disabling HTTP retries; runtime behavior remains unverified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit e4fbbd7

@dd-octo-sts

dd-octo-sts Bot commented Oct 16, 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 13.95 s 13.85 s [+0.1%; +1.4%] (maybe worse)
startup:insecure-bank:tracing:Agent 12.92 s 12.97 s [-1.0%; +0.3%] (no difference)
startup:petclinic:appsec:Agent 17.06 s 16.89 s [+0.1%; +2.0%] (maybe worse)
startup:petclinic:iast:Agent 16.91 s 16.99 s [-1.3%; +0.3%] (no difference)
startup:petclinic:profiling:Agent 16.51 s 16.70 s [-2.3%; -0.1%] (maybe better)
startup:petclinic:sca:Agent 17.05 s 16.80 s [+0.5%; +2.4%] (maybe worse)
startup:petclinic:tracing:Agent 16.01 s 16.10 s [-1.4%; +0.4%] (no difference)

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

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

LGTM, I added small comment about re-wording the comment.

amarziali and others added 2 commits October 16, 2026 17:05
…9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/JettyContinuationHandlerTest.groovy

Co-authored-by: Alexey Kuznetsov <alexey.kuznetsov@datadoghq.com>
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.81% (-0.01%)

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

@amarziali
amarziali enabled auto-merge October 16, 2026 16:01
@amarziali
amarziali added this pull request to the merge queue Oct 16, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-16 16:03:50 UTC ℹ️ Start processing command /merge


2026-10-16 16:03:54 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-10-16 17:03:52 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 Oct 16, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 6dbd635 into master Oct 16, 2026
609 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/fix-jetty90-continuation-body-race branch October 16, 2026 17:03
@github-actions github-actions Bot added this to the 1.68.0 milestone Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: jetty Jetty instrumentation tag: flaky test Flaky tests tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants