Skip to content

Fix Jetty continuation test fixture race - #12678

Open
amarziali wants to merge 2 commits into
masterfrom
andrea.marziali/jetty-continuation-flake
Open

amarziali wants to merge 2 commits into
masterfrom
andrea.marziali/jetty-continuation-flake

Conversation

@amarziali

Copy link
Copy Markdown
Contributor

What Does This Do

Fixes a race in the Jetty 9.3 continuation test fixture.

The fixture could resume a continuation before Jetty published its timeout task. The resumed dispatch would therefore find no task to cancel, while the initial request thread could subsequently schedule one with
the captured request context.

flowchart LR
  A[Initial Jetty thread] -->|#0 captured and finished| B[Fixture executor]
  B -->|resume; #1 captured and finished| C[Resumed Jetty dispatch]
  C -->|cancel sees no timeout task| D[Request completes]
  A -.->|#2 scheduled afterward| E[Uncancelled timeout task]

  classDef healthy fill:#d9f7df,stroke:#27823b
  classDef leaked fill:#ffdede,stroke:#b3261e
  class B,C,D healthy
  class E leaked
Loading

The fix establishes the required lifecycle ordering in the test fixture so the timeout task cannot be published after cancellation.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

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

chatgpt-codex-connector Bot commented Sep 29, 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-29T09:39:10.688560Z a18a5c1 PR opened
🔒 Security Review ✅ Completed 2026-09-29T09:35:46.657359Z a18a5c1 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a18a5c16ff

ℹ️ 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".

@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: FAIL

The new ten-second publication wait is guarded by a one-second continuation timeout, allowing Jetty to fire and clear the task before the waiter observes it under executor stalls.

Open Bits AI session

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

@dd-octo-sts

dd-octo-sts Bot commented Sep 29, 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.99 s 13.96 s [-0.7%; +1.2%] (no difference)
startup:insecure-bank:tracing:Agent 12.91 s 13.00 s [-1.5%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.03 s 16.85 s [+0.3%; +1.9%] (maybe worse)
startup:petclinic:iast:Agent 16.96 s 16.49 s [-1.3%; +7.1%] (no difference)
startup:petclinic:profiling:Agent 16.48 s 16.81 s [-2.8%; -1.2%] (significantly better)
startup:petclinic:sca:Agent 16.20 s 16.81 s [-7.9%; +0.7%] (no difference)
startup:petclinic:tracing:Agent 16.18 s 16.12 s [-0.4%; +1.2%] (no difference)

Commit: 0cfcbba8 · 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

Copy link
Copy Markdown
Contributor Author

@DataDog review

@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

Waiting for Jetty’s volatile timeout-task publication before resuming ensures the resumed dispatch can cancel the task, closing the reported fixture race across supported Jetty versions.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 0cfcbba · @DataDog review to ask questions

This branch has not been deployed

No deployments
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.

1 participant