Skip to content

Disable invokedynamic bytecode for legacy Gradle instrumentation#11618

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
daniel.mohedano/fix-gradle-legacy-compilation
Jun 10, 2026
Merged

Disable invokedynamic bytecode for legacy Gradle instrumentation#11618
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
daniel.mohedano/fix-gradle-legacy-compilation

Conversation

@daniel-mohedano

@daniel-mohedano daniel-mohedano commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

  • Disables invokedynamic bytecode generation for the legacy ([3.0, 8.3)) Gradle instrumentation to keep it compatible with Gradle versions older than 7.0.
  • Bumps the oldest gradle legacy test from 3.5 to 4.10 so that it is compatible with the project's TestKit and therefore executed (it was currently being skipped).

Motivation

#11436 bumped the project's Gradle version from 8.14.5 to 9.5.1. The Groovy version bundled with Gradle was also bumped, from 3.0 to 4.0. This version of Groovy now enables invokedynamic bytecode generation by default, instead of using the classic call-site caching mechanism used previously.

Parts of the legacy Gradle instrumentation are implemented in Groovy and compiled with the project's bundled Groovy compiler. After the bump, the dynamic calls in the code are emitted as invokedynamic instructions that bootstrap through org.codehaus.groovy.vmplugin.v8.IndyInterface.bootstrap(...), instead of the previous call-site dispatch via org.codehaus.groovy.runtime.callsite.CallSite.

These instrumentation classes are loaded into the user's Gradle daemon at runtime, so they have to link against the Groovy runtime bundled in that daemon's Gradle distribution, which can be much older than the Gradle/Groovy used to build the agent. vmplugin.v8.IndyInterface only exists from Groovy 3.0 onwards (in Groovy 2.x the equivalent class lived under vmplugin.v7). As a result, any build run with a Gradle distribution that bundles Groovy 2.x, Gradle 6.x and earlier (Gradle 7.0 was the first to bundle Groovy 3.0), cannot resolve the bootstrap method. The instrumentation classes fail to link, so CI Visibility never instruments the project's test tasks and no test events are produced.

Additional Notes

The failure was caught through the netflix-zuul and reactive-streams-jvm projects in the test-environment, as the "oldest version" smoke test was being skipped.

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]

@daniel-mohedano daniel-mohedano added type: bug Bug report and fix comp: ci visibility Continuous Integration Visibility labels Jun 10, 2026
@datadog-official

This comment has been minimized.

@daniel-mohedano daniel-mohedano changed the title Disable invokedynamic compilation for legacy gradle instrumentation Disable invokedynamic bytecode for legacy gradle instrumentation Jun 10, 2026
@daniel-mohedano daniel-mohedano changed the title Disable invokedynamic bytecode for legacy gradle instrumentation Disable invokedynamic bytecode for legacy Gradle instrumentation Jun 10, 2026
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Test Environment - sbt-scalatest

Job Status: success

Scenario Overhead (%)
agent 53.18
agentEvpProxy 53.50

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Test Environment - netflix-zuul

Job Status: success

Scenario Overhead (%)
agent 86.92
agentless 80.29
agentlessCodeCoverage 95.81
agentlessLineCoverage 111.95

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Test Environment - nebula-release-plugin

Job Status: success

Scenario Overhead (%)
agent 35.41
agentless 34.77
agentlessCodeCoverage 43.70
agentlessLineCoverage 75.34

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Test Environment - reactive-streams-jvm

Job Status: success

Scenario Overhead (%)
agent 23.13
agentless 18.65
agentlessCodeCoverage 20.06
agentlessLineCoverage 30.04

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Test Environment - pass4s

Job Status: success

Scenario Overhead (%)
agent 12.79
agentless 11.45
agentlessCodeCoverage 17.84

@dd-octo-sts

dd-octo-sts Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

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.69 s [+0.3%; +2.1%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.70 s 13.69 s [-0.7%; +0.8%] (no difference)
startup:petclinic:appsec:Agent 17.44 s 17.21 s [+0.4%; +2.4%] (maybe worse)
startup:petclinic:iast:Agent 17.44 s 17.48 s [-1.2%; +0.7%] (no difference)
startup:petclinic:profiling:Agent 17.46 s 16.96 s [-1.6%; +7.5%] (no difference)
startup:petclinic:sca:Agent 17.54 s 17.42 s [-0.1%; +1.5%] (no difference)
startup:petclinic:tracing:Agent 16.07 s 16.53 s [-7.0%; +1.5%] (no difference)

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

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Test Environment - jolokia

Job Status: success

Scenario Overhead (%)
agent 95.07
agentless 89.29
agentlessCodeCoverage 99.65
agentlessLineCoverage 99.86

@daniel-mohedano daniel-mohedano marked this pull request as ready for review June 10, 2026 15:18
@daniel-mohedano daniel-mohedano requested a review from a team as a code owner June 10, 2026 15:18
// dispatch so the emitted bytecode links on older daemons regardless of the build's
// bundled Groovy version.
tasks.withType(GroovyCompile).configureEach {
groovyOptions.optimizationOptions.indy = false

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.

praise: TIL

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Test Environment - sonar-java

Job Status: success

Scenario Overhead (%)
agent 15.96
agentless -1.73
agentlessCodeCoverage 41.16
agentlessLineCoverage 115.16

@daniel-mohedano

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-10 16:55:13 UTC ℹ️ Start processing command /merge


2026-06-10 16:55:18 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-06-10 17:57:03 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 9bf338b into master Jun 10, 2026
596 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the daniel.mohedano/fix-gradle-legacy-compilation branch June 10, 2026 17:57
@github-actions github-actions Bot added this to the 1.64.0 milestone Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: ci visibility Continuous Integration Visibility type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants