Avoid final field modification in Weaver instrumentation#11728
Conversation
Test Environment - sbt-scalatestJob Status: 🟢 success
Baseline: median of |
Test Environment - nebula-release-pluginJob Status: 🟢 success
Baseline: median of |
Test Environment - netflix-zuulJob Status: 🟢 success
Baseline: median of |
Test Environment - pass4sJob Status: 🟢 success
Baseline: median of |
Test Environment - reactive-streams-jvmJob Status: 🟢 success
Baseline: median of |
Test Environment - sonar-kotlinJob Status: 🟢 success
Baseline: median of |
Test Environment - jolokiaJob Status: 🟢 success
Baseline: median of |
Test Environment - okhttpJob Status: 🟢 success
Baseline: median of |
Test Environment - spring_bootJob Status: 🟢 success
Baseline: median of |
There was a problem hiding this comment.
More details
Argument index 5 for the queue parameter is verified by javap disassembly of both Disney 0.8.4 (ConcurrentLinkedQueue) and typelevel 0.9+ (LinkedBlockingQueue) SbtTask constructors — the queue lands at JVM local slot 6 (0-based arg index 5) in both versions, and the field is confirmed ACC_PRIVATE, ACC_FINAL. All proxy delegation, double-wrap guard, and null-event handling scenarios pass synthetic execution. The OnMethodEnter approach also eliminates a narrow race window that existed in the old OnMethodExit approach.
📊 Validated against 6 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 5586d54 · What is Autotest? · Any feedback? Reach out in #autotest
…/trace/instrumentation/weaver/WeaverInstrumentation.java Co-authored-by: Brice Dutheil <[email protected]>
…/trace/instrumentation/weaver/WeaverInstrumentation.java Co-authored-by: Brice Dutheil <[email protected]>
Test Environment - sonar-javaJob Status: 🟢 success
Baseline: median of |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
fix: avoid final field modification in Weaver instrumentation Update dd-java-agent/instrumentation/weaver-0.9/src/main/java/datadog/trace/instrumentation/weaver/WeaverInstrumentation.java Co-authored-by: Brice Dutheil <[email protected]> Update dd-java-agent/instrumentation/weaver-0.9/src/main/java/datadog/trace/instrumentation/weaver/WeaverInstrumentation.java Co-authored-by: Brice Dutheil <[email protected]> Co-authored-by: daniel.mohedano <[email protected]>
What Does This Do
OnMethodEnterinstead of modifying the fieldOnMethodExit.Motivation
Avoid failures in future JDKs due to JEP 500: Prepare to Make Final Mean Final.
Additional Notes
Running an example project on JDK26 with
JAVA_TOOL_OPTIONS: --illegal-final-field-mutation=debugproduced the following logs:The build containing the fix doesn't produce the logs.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/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)Jira ticket: SDTEST-3866