-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crash using Mule with JPMS #8187
Conversation
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
public class JpmsAdvisingHelper { | ||
private static final WeakHashMap<Module, Boolean> ALREADY_PROCESSED_CACHE = new WeakHashMap<>(); | ||
|
||
public static boolean isModuleAlreadyProcessed(final Module module) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't need synchornisation here. It's not bad if it's called twice
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 5 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~817c5ed1e7, baseline=1.46.0-SNAPSHOT~82e3386fa9
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.056 s) : 0, 1055780
Total [baseline] (8.624 s) : 0, 8623848
Agent [candidate] (1.062 s) : 0, 1061866
Total [candidate] (8.655 s) : 0, 8655247
section iast
Agent [baseline] (1.18 s) : 0, 1179962
Total [baseline] (9.21 s) : 0, 9209545
Agent [candidate] (1.182 s) : 0, 1181818
Total [candidate] (9.197 s) : 0, 9196992
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.198 s) : 0, 1197782
Total [baseline] (9.219 s) : 0, 9218867
Agent [candidate] (1.184 s) : 0, 1184312
Total [candidate] (9.23 s) : 0, 9229931
section iast_TELEMETRY_OFF
Agent [baseline] (1.178 s) : 0, 1177699
Total [baseline] (9.2 s) : 0, 9200262
Agent [candidate] (1.184 s) : 0, 1184142
Total [candidate] (9.224 s) : 0, 9224189
gantt
title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~817c5ed1e7, baseline=1.46.0-SNAPSHOT~82e3386fa9
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (713.953 ms) : 0, 713953
BytebuddyAgent [candidate] (718.274 ms) : 0, 718274
GlobalTracer [baseline] (255.739 ms) : 0, 255739
GlobalTracer [candidate] (257.225 ms) : 0, 257225
AppSec [baseline] (56.687 ms) : 0, 56687
AppSec [candidate] (56.257 ms) : 0, 56257
Remote Config [baseline] (723.683 µs) : 0, 724
Remote Config [candidate] (758.632 µs) : 0, 759
Telemetry [baseline] (13.66 ms) : 0, 13660
Telemetry [candidate] (14.217 ms) : 0, 14217
section iast
BytebuddyAgent [baseline] (830.065 ms) : 0, 830065
BytebuddyAgent [candidate] (831.411 ms) : 0, 831411
GlobalTracer [baseline] (246.177 ms) : 0, 246177
GlobalTracer [candidate] (246.63 ms) : 0, 246630
AppSec [baseline] (57.855 ms) : 0, 57855
AppSec [candidate] (57.997 ms) : 0, 57997
Remote Config [baseline] (672.982 µs) : 0, 673
Remote Config [candidate] (680.579 µs) : 0, 681
Telemetry [baseline] (8.806 ms) : 0, 8806
Telemetry [candidate] (8.7 ms) : 0, 8700
IAST [baseline] (21.353 ms) : 0, 21353
IAST [candidate] (21.396 ms) : 0, 21396
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (842.871 ms) : 0, 842871
BytebuddyAgent [candidate] (832.956 ms) : 0, 832956
GlobalTracer [baseline] (249.291 ms) : 0, 249291
GlobalTracer [candidate] (247.251 ms) : 0, 247251
AppSec [baseline] (58.684 ms) : 0, 58684
AppSec [candidate] (58.056 ms) : 0, 58056
Remote Config [baseline] (710.913 µs) : 0, 711
Remote Config [candidate] (669.066 µs) : 0, 669
Telemetry [baseline] (9.129 ms) : 0, 9129
Telemetry [candidate] (8.761 ms) : 0, 8761
IAST [baseline] (22.018 ms) : 0, 22018
IAST [candidate] (21.58 ms) : 0, 21580
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (828.078 ms) : 0, 828078
BytebuddyAgent [candidate] (832.779 ms) : 0, 832779
GlobalTracer [baseline] (246.814 ms) : 0, 246814
GlobalTracer [candidate] (247.842 ms) : 0, 247842
AppSec [baseline] (57.844 ms) : 0, 57844
AppSec [candidate] (58.17 ms) : 0, 58170
Remote Config [baseline] (644.946 µs) : 0, 645
Remote Config [candidate] (670.017 µs) : 0, 670
Telemetry [baseline] (8.607 ms) : 0, 8607
Telemetry [candidate] (8.656 ms) : 0, 8656
IAST [baseline] (20.663 ms) : 0, 20663
IAST [candidate] (20.933 ms) : 0, 20933
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~817c5ed1e7, baseline=1.46.0-SNAPSHOT~82e3386fa9
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1056943
Total [baseline] (10.474 s) : 0, 10474176
Agent [candidate] (1.061 s) : 0, 1060812
Total [candidate] (10.509 s) : 0, 10509409
section appsec
Agent [baseline] (1.189 s) : 0, 1189490
Total [baseline] (10.724 s) : 0, 10723968
Agent [candidate] (1.195 s) : 0, 1194650
Total [candidate] (10.768 s) : 0, 10768264
section iast
Agent [baseline] (1.182 s) : 0, 1181887
Total [baseline] (11.044 s) : 0, 11044452
Agent [candidate] (1.183 s) : 0, 1183120
Total [candidate] (10.986 s) : 0, 10986277
section profiling
Agent [baseline] (1.272 s) : 0, 1272031
Total [baseline] (10.945 s) : 0, 10944991
Agent [candidate] (1.278 s) : 0, 1278151
Total [candidate] (10.838 s) : 0, 10838411
gantt
title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~817c5ed1e7, baseline=1.46.0-SNAPSHOT~82e3386fa9
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (714.256 ms) : 0, 714256
BytebuddyAgent [candidate] (718.325 ms) : 0, 718325
GlobalTracer [baseline] (255.992 ms) : 0, 255992
GlobalTracer [candidate] (256.923 ms) : 0, 256923
AppSec [baseline] (56.623 ms) : 0, 56623
AppSec [candidate] (56.042 ms) : 0, 56042
Remote Config [baseline] (722.382 µs) : 0, 722
Remote Config [candidate] (720.366 µs) : 0, 720
Telemetry [baseline] (14.317 ms) : 0, 14317
Telemetry [candidate] (13.721 ms) : 0, 13721
section appsec
BytebuddyAgent [baseline] (731.281 ms) : 0, 731281
BytebuddyAgent [candidate] (734.695 ms) : 0, 734695
GlobalTracer [baseline] (253.503 ms) : 0, 253503
GlobalTracer [candidate] (254.463 ms) : 0, 254463
AppSec [baseline] (171.091 ms) : 0, 171091
AppSec [candidate] (171.518 ms) : 0, 171518
IAST [baseline] (19.466 ms) : 0, 19466
IAST [candidate] (19.794 ms) : 0, 19794
Remote Config [baseline] (662.178 µs) : 0, 662
Remote Config [candidate] (672.649 µs) : 0, 673
Telemetry [baseline] (8.206 ms) : 0, 8206
Telemetry [candidate] (8.32 ms) : 0, 8320
section iast
BytebuddyAgent [baseline] (831.213 ms) : 0, 831213
BytebuddyAgent [candidate] (831.639 ms) : 0, 831639
GlobalTracer [baseline] (246.614 ms) : 0, 246614
GlobalTracer [candidate] (247.346 ms) : 0, 247346
AppSec [baseline] (57.926 ms) : 0, 57926
AppSec [candidate] (58.157 ms) : 0, 58157
IAST [baseline] (21.646 ms) : 0, 21646
IAST [candidate] (21.462 ms) : 0, 21462
Remote Config [baseline] (675.627 µs) : 0, 676
Remote Config [candidate] (658.773 µs) : 0, 659
Telemetry [baseline] (8.819 ms) : 0, 8819
Telemetry [candidate] (8.756 ms) : 0, 8756
section profiling
BytebuddyAgent [baseline] (703.714 ms) : 0, 703714
BytebuddyAgent [candidate] (707.61 ms) : 0, 707610
GlobalTracer [baseline] (367.437 ms) : 0, 367437
GlobalTracer [candidate] (368.417 ms) : 0, 368417
AppSec [baseline] (53.753 ms) : 0, 53753
AppSec [candidate] (54.128 ms) : 0, 54128
Remote Config [baseline] (687.238 µs) : 0, 687
Remote Config [candidate] (691.749 µs) : 0, 692
Telemetry [baseline] (8.784 ms) : 0, 8784
Telemetry [candidate] (8.864 ms) : 0, 8864
ProfilingAgent [baseline] (95.59 ms) : 0, 95590
ProfilingAgent [candidate] (96.059 ms) : 0, 96059
Profiling [baseline] (95.614 ms) : 0, 95614
Profiling [candidate] (96.085 ms) : 0, 96085
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~817c5ed1e7, baseline=1.46.0-SNAPSHOT~82e3386fa9
dateFormat X
axisFormat %s
section baseline
no_agent (1.353 ms) : 1334, 1373
. : milestone, 1353,
appsec (1.74 ms) : 1716, 1763
. : milestone, 1740,
appsec_no_iast (1.759 ms) : 1736, 1782
. : milestone, 1759,
iast (1.512 ms) : 1490, 1535
. : milestone, 1512,
profiling (1.523 ms) : 1499, 1548
. : milestone, 1523,
tracing (1.492 ms) : 1468, 1517
. : milestone, 1492,
section candidate
no_agent (1.362 ms) : 1342, 1381
. : milestone, 1362,
appsec (1.736 ms) : 1712, 1759
. : milestone, 1736,
appsec_no_iast (1.757 ms) : 1733, 1781
. : milestone, 1757,
iast (1.492 ms) : 1469, 1515
. : milestone, 1492,
profiling (1.501 ms) : 1477, 1525
. : milestone, 1501,
tracing (1.501 ms) : 1476, 1526
. : milestone, 1501,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~817c5ed1e7, baseline=1.46.0-SNAPSHOT~82e3386fa9
dateFormat X
axisFormat %s
section baseline
no_agent (382.759 µs) : 363, 402
. : milestone, 383,
iast (487.128 µs) : 466, 509
. : milestone, 487,
iast_FULL (655.788 µs) : 634, 677
. : milestone, 656,
iast_GLOBAL (528.561 µs) : 506, 551
. : milestone, 529,
iast_HARDCODED_SECRET_DISABLED (495.882 µs) : 474, 517
. : milestone, 496,
iast_INACTIVE (447.429 µs) : 427, 468
. : milestone, 447,
iast_TELEMETRY_OFF (482.537 µs) : 461, 505
. : milestone, 483,
tracing (455.399 µs) : 434, 477
. : milestone, 455,
section candidate
no_agent (372.812 µs) : 353, 393
. : milestone, 373,
iast (491.458 µs) : 469, 514
. : milestone, 491,
iast_FULL (658.206 µs) : 636, 680
. : milestone, 658,
iast_GLOBAL (514.109 µs) : 493, 535
. : milestone, 514,
iast_HARDCODED_SECRET_DISABLED (498.382 µs) : 476, 520
. : milestone, 498,
iast_INACTIVE (448.07 µs) : 427, 469
. : milestone, 448,
iast_TELEMETRY_OFF (487.776 µs) : 465, 510
. : milestone, 488,
tracing (447.071 µs) : 426, 468
. : milestone, 447,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~817c5ed1e7, baseline=1.46.0-SNAPSHOT~82e3386fa9
dateFormat X
axisFormat %s
section baseline
no_agent (1.471 ms) : 1460, 1483
. : milestone, 1471,
appsec (2.368 ms) : 2325, 2411
. : milestone, 2368,
iast (2.109 ms) : 2054, 2163
. : milestone, 2109,
iast_GLOBAL (2.162 ms) : 2107, 2217
. : milestone, 2162,
profiling (1.963 ms) : 1920, 2007
. : milestone, 1963,
tracing (1.953 ms) : 1911, 1995
. : milestone, 1953,
section candidate
no_agent (1.471 ms) : 1460, 1483
. : milestone, 1471,
appsec (2.359 ms) : 2317, 2402
. : milestone, 2359,
iast (2.108 ms) : 2054, 2163
. : milestone, 2108,
iast_GLOBAL (2.154 ms) : 2099, 2208
. : milestone, 2154,
profiling (1.972 ms) : 1928, 2015
. : milestone, 1972,
tracing (1.947 ms) : 1905, 1989
. : milestone, 1947,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~817c5ed1e7, baseline=1.46.0-SNAPSHOT~82e3386fa9
dateFormat X
axisFormat %s
section baseline
no_agent (15.393 s) : 15393000, 15393000
. : milestone, 15393000,
appsec (15.031 s) : 15031000, 15031000
. : milestone, 15031000,
iast (18.555 s) : 18555000, 18555000
. : milestone, 18555000,
iast_GLOBAL (18.081 s) : 18081000, 18081000
. : milestone, 18081000,
profiling (15.213 s) : 15213000, 15213000
. : milestone, 15213000,
tracing (15.122 s) : 15122000, 15122000
. : milestone, 15122000,
section candidate
no_agent (14.712 s) : 14712000, 14712000
. : milestone, 14712000,
appsec (14.722 s) : 14722000, 14722000
. : milestone, 14722000,
iast (18.81 s) : 18810000, 18810000
. : milestone, 18810000,
iast_GLOBAL (18.349 s) : 18349000, 18349000
. : milestone, 18349000,
profiling (15.194 s) : 15194000, 15194000
. : milestone, 15194000,
tracing (15.028 s) : 15028000, 15028000
. : milestone, 15028000,
|
a853a04
to
fada2a5
Compare
...mentation/mule-4/src/main/java11/datadog/trace/instrumentation/mule4/JpmsAdvisingHelper.java
Show resolved
Hide resolved
fada2a5
to
a85b577
Compare
a85b577
to
817c5ed
Compare
|
||
main_java11CompileOnly project(':internal-api') | ||
main_java11CompileOnly project(':dd-java-agent:agent-tooling') | ||
main_java11CompileOnly project(':dd-java-agent:agent-bootstrap') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main_java11CompileOnly project(':dd-java-agent:agent-bootstrap') |
I don't believe you need agent-bootstrap
to compile what's currently under the java11
folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
After the refactoring there's nothing mule-specific about JpmsAdvisingHelper
and JpmsClearanceAdvice
so we could move them to dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/jpms
in a separate PR, but lets get this in and backported first
@mcculls that code has to be inlined inside the transformed class so, if I move in a different package I think it won't work anymore as expected. Did you mean that we can have a generic advice we can reuse also for other similar needs? |
What Does This Do
When mulesoft use the internal jpms module layering, application deployment fails because of
DDEventTracer
uses internal mule classes not opened/exported to the unnamed module.This PR make the needed module export all the packages to unnamed (where our code resides) in order to avoid this issue
solves #8130
Motivation
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]