Skip to content

Update MethodParameters detection for fixed JDK#12025

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
jpbempel/update-method-param-detection
Jul 23, 2026
Merged

Update MethodParameters detection for fixed JDK#12025
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
jpbempel/update-method-param-detection

Conversation

@jpbempel

Copy link
Copy Markdown
Member

What Does This Do

JDK 17.0.20 fixes the Method Parameters bug (JDK-8240908) so we are updating the detection to filter out for this JDK version and onward

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@jpbempel
jpbempel requested a review from a team as a code owner July 22, 2026 09:11
@jpbempel
jpbempel requested review from dudikeleti and removed request for a team July 22, 2026 09:11
@jpbempel jpbempel added comp: debugger Dynamic Instrumentation type: bug fix Bug fix labels Jul 22, 2026

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

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

ClassNode classNode, List<ProbeDefinition> definitions, String fullyQualifiedClassName) {
if (JAVA_AT_LEAST_19) {
// bug is fixed since JDK19, no need to perform check
if (JAVA_AT_LEAST_19 || JAVA_AT_LEAST_17_0_20) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate the 17.0.20 shortcut to Java 17

On Java 18, JavaVirtualMachine.isJavaVersionAtLeast(17, 0, 20) is true because it compares the major version first, even though the adjacent comment says this JDK bug is fixed only in JDK 19 and in the 17.0.20 backport. In Java 18 Spring 6 apps with -parameters classes, this makes checkMethodParameters return early and allows retransformation to strip the MethodParameters attribute again; the same predicate was added in ConfigurationUpdater, so please combine the backport check with isJavaVersion(17) while keeping the JDK 19+ shortcut.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

true, but JDK18 is marginal, don't bother

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@jpbempel, I disagree. The version detection should be correct, and it would not be rocket science to implement it correctly.

@jpbempel jpbempel Jul 22, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

JDK18 is not supported anymore by any vendors
JDK18 represents a very very marginal number for dd-trace-java installations.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You mentioned that already. IMO, fixing the condition would still be quicker than explaining why you won't fix it. Besides, it would be cleaner, too, and the code would be nicely self-documenting.

int result = Reflect.onClass(testClass).call("main", "1").get();
assertEquals(3, result);
if (JavaVirtualMachine.isJavaVersion(17)) {
if (JavaVirtualMachine.isJavaVersionBetween(17, 0, 0, 17, 0, 19)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include Java 17.0.19 in the affected test range

On Java 17.0.19 this branch is false because isJavaVersionBetween(..., 17, 0, 19) uses an exclusive upper bound, but the fix being modeled is 17.0.20 and the setup above still loads the Spring class for any Java 17. The transformer will therefore reject the MethodParameters instrumentation on 17.0.19 while the test expects a snapshot, so this should use 17.0.20 as the exclusive upper bound.

Useful? React with 👍 / 👎.

@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

PR correctly updates Method Parameters detection to skip checks on JDK 17.0.20+ where the OpenJDK bug (JDK-8240908) is fixed, alongside existing JDK 19+ handling. Version logic is correct and tests properly scope expectations. Significant scope creep includes unrelated annotation parameter reordering and benchmark deletion, but these changes are cosmetic and pose no behavioral risk.

Was this helpful? React 👍 or 👎

📊 Validated against 11 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit cb6a478 · What is Autotest? · Any feedback? Reach out in #autotest

@datadog-official

datadog-official Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 66.67%
Overall Coverage: 74.44% (+16.91%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6e248fb | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jul 22, 2026

Copy link
Copy Markdown

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1784824139 1784824485
end_time 2026-07-23T16:30:24 2026-07-23T16:36:10
git_branch master jpbempel/update-method-param-detection
git_commit_sha b065fc3 6e248fb
start_time 2026-07-23T16:28:59 2026-07-23T16:34:46
See matching parameters
Baseline Candidate
ci_job_id 1887959426 1887959426
ci_pipeline_id 126581135 126581135
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1784823260 1784823260

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 9 metrics, 6 unstable metrics.

See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-60.374µs; +25.333µs] or [-19.605%; +8.226%]
unstable
[-77.900µs; +36.845µs] or [-21.985%; +10.399%]
unstable
[-87.572µs; +44.784µs] or [-23.592%; +12.065%]
unstable
[-605.046µs; +191.682µs] or [-43.968%; +13.929%]
same
scenario:basic same same same unstable
[-165.136µs; +119.775µs] or [-14.841%; +10.764%]
unstable
[-125.571op/s; +247.522op/s] or [-5.148%; +10.148%]
scenario:loop unsure
[-10.798µs; -2.939µs] or [-0.121%; -0.033%]
same unsure
[-11.007µs; -0.238µs] or [-0.121%; -0.003%]
same same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (354.325 µs) : 284, 425
.   : milestone, 354,
basic (297.95 µs) : 289, 307
.   : milestone, 298,
loop (8.995 ms) : 8989, 9001
.   : milestone, 8995,
section candidate
noprobe (333.798 µs) : 302, 366
.   : milestone, 334,
basic (295.761 µs) : 289, 303
.   : milestone, 296,
loop (8.989 ms) : 8984, 8994
.   : milestone, 8989,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 354.325 µs [284.146 µs, 424.505 µs]
basic 297.95 µs [289.182 µs, 306.719 µs]
loop 8.995 ms [8.989 ms, 9.001 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 333.798 µs [301.792 µs, 365.803 µs]
basic 295.761 µs [288.877 µs, 302.645 µs]
loop 8.989 ms [8.984 ms, 8.994 ms]

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

looks like a repeat comment/concern on the version checks but otherwise lgtm

List<Class<?>> changedClasses) {
if (JAVA_AT_LEAST_19) {
// bug is fixed since JDK19, no need to perform detection
if (JAVA_AT_LEAST_19 || JAVA_AT_LEAST_17_0_20) {

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.

nit: could we just check for the new version? checking for java 19 feels redundant now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

right, done

@kriegaex kriegaex Jul 24, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What? No! The correct condition is something like

if (JAVA_AT_LEAST_19 || JAVA_AT_LEAST_17_0_20 && !JAVA_AT_LEAST_18) {

Why not just make it correct? Why did you choose incorrect heuristics instead of this simple, correct, efficient and not significantly more complicated solution?

jpbempel added 2 commits July 23, 2026 18:13
JDK 17.0.20 fixes the Method Parameters bug (JDK-8240908) so we are
updating the detection to filter out for this JDK version and onward

# Conflicts:
#	dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTransformer.java
@dd-octo-sts

dd-octo-sts Bot commented Jul 23, 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.03 s 13.97 s [-0.4%; +1.2%] (no difference)
startup:insecure-bank:tracing:Agent 12.92 s 12.99 s [-1.2%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 16.35 s 16.75 s [-6.9%; +2.0%] (no difference)
startup:petclinic:iast:Agent 16.87 s 16.92 s [-1.2%; +0.6%] (no difference)
startup:petclinic:profiling:Agent 16.53 s 16.87 s [-3.1%; -1.0%] (maybe better)
startup:petclinic:sca:Agent 16.99 s 16.63 s [+1.1%; +3.3%] (significantly worse)
startup:petclinic:tracing:Agent 15.76 s 16.05 s [-6.0%; +2.4%] (no difference)

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

@jpbempel
jpbempel force-pushed the jpbempel/update-method-param-detection branch from 8271c3a to 6e248fb Compare July 23, 2026 16:19
@jpbempel
jpbempel added this pull request to the merge queue Jul 23, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 23, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-23 17:35:10 UTC ℹ️ Start processing command /merge


2026-07-23 17:35:15 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-07-23 18:32:11 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 Jul 23, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 0bf04c1 into master Jul 23, 2026
595 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the jpbempel/update-method-param-detection branch July 23, 2026 18:32
@github-actions github-actions Bot added this to the 1.65.0 milestone Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: debugger Dynamic Instrumentation type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants