Skip to content

Avoid leaking continuations on jdk-http-client#11557

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
andrea.marziali/jdk-httpclient
Jun 4, 2026
Merged

Avoid leaking continuations on jdk-http-client#11557
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
andrea.marziali/jdk-httpclient

Conversation

@amarziali
Copy link
Copy Markdown
Contributor

What Does This Do

This PR applies several fixes on the jdk http client instrumentation.

  • Disable capturing continuations on send/sendAsync to avoid being captured on the underlying fork-join used for scheduling
  • Lazy capture continuations on the BodyHandlerWrapper to avoid having cases when the handler is not called and the continuation not used/canceled

The tests confirm that everything now works as expected. Before was failing when enabling the strictTraceWrite

Now the async disable has been added to the "catch-all" disable instrumentation. Thoughts on it since it's becoming a bit big in terms of matchers and I don't know if we should think about a refactoring/split

Motivation

Additional Notes

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@amarziali amarziali requested a review from a team as a code owner June 4, 2026 09:06
@amarziali amarziali removed the request for review from a team June 4, 2026 09:06
@amarziali amarziali added the type: enhancement Enhancements and improvements label Jun 4, 2026
@amarziali amarziali added the inst: others All other instrumentations label Jun 4, 2026
@amarziali amarziali requested a review from mcculls June 4, 2026 09:07
Copy link
Copy Markdown

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

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: fb1a841e37

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

@PerfectSlayer PerfectSlayer added inst: java Core Java language instrumentation and removed inst: others All other instrumentations labels Jun 4, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 4, 2026

🟢 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.09 s 13.93 s [+0.2%; +2.2%] (maybe worse)
startup:insecure-bank:tracing:Agent 12.89 s 12.86 s [-0.5%; +1.1%] (no difference)
startup:petclinic:appsec:Agent 15.67 s 16.34 s [-12.7%; +4.5%] (unstable)
startup:petclinic:iast:Agent 16.55 s 16.48 s [-0.3%; +1.1%] (no difference)
startup:petclinic:profiling:Agent 16.49 s 16.44 s [-1.1%; +1.7%] (no difference)
startup:petclinic:tracing:Agent 14.94 s 15.87 s [-13.9%; +2.3%] (unstable)

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

Copy link
Copy Markdown
Contributor

@mcculls mcculls left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

Make sense. Thanks for the improvement 👍

@amarziali
Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented Jun 4, 2026

View all feedbacks in Devflow UI.

2026-06-04 12:28:11 UTC ℹ️ Start processing command /merge


2026-06-04 12:28:16 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-06-04 13:45:39 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit cb71f86 into master Jun 4, 2026
571 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/jdk-httpclient branch June 4, 2026 13:45
@github-actions github-actions Bot added this to the 1.64.0 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: java Core Java language instrumentation type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants