-
Notifications
You must be signed in to change notification settings - Fork 306
Use JDK 8 explicitly as toolchain #8883
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
base: master
Are you sure you want to change the base?
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 43 metrics, 10 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.51.0-SNAPSHOT~b2e8d4e670, baseline=1.51.0-SNAPSHOT~aa9dd27535
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.028 s) : 0, 1027876
Total [baseline] (8.587 s) : 0, 8587319
Agent [candidate] (1.027 s) : 0, 1027305
Total [candidate] (8.548 s) : 0, 8547988
section iast
Agent [baseline] (1.175 s) : 0, 1174692
Total [baseline] (9.268 s) : 0, 9268420
Agent [candidate] (1.151 s) : 0, 1151054
Total [candidate] (9.192 s) : 0, 9191998
gantt
title insecure-bank - break down per module: candidate=1.51.0-SNAPSHOT~b2e8d4e670, baseline=1.51.0-SNAPSHOT~aa9dd27535
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (687.383 ms) : 0, 687383
BytebuddyAgent [candidate] (687.452 ms) : 0, 687452
GlobalTracer [baseline] (242.635 ms) : 0, 242635
GlobalTracer [candidate] (242.683 ms) : 0, 242683
AppSec [baseline] (57.907 ms) : 0, 57907
AppSec [candidate] (57.384 ms) : 0, 57384
Debugger [baseline] (7.018 ms) : 0, 7018
Debugger [candidate] (7.771 ms) : 0, 7771
Remote Config [baseline] (670.728 µs) : 0, 671
Remote Config [candidate] (661.683 µs) : 0, 662
Telemetry [baseline] (11.338 ms) : 0, 11338
Telemetry [candidate] (10.454 ms) : 0, 10454
section iast
BytebuddyAgent [baseline] (824.488 ms) : 0, 824488
BytebuddyAgent [candidate] (805.24 ms) : 0, 805240
GlobalTracer [baseline] (234.625 ms) : 0, 234625
GlobalTracer [candidate] (231.631 ms) : 0, 231631
IAST [baseline] (27.774 ms) : 0, 27774
IAST [candidate] (27.415 ms) : 0, 27415
AppSec [baseline] (52.053 ms) : 0, 52053
AppSec [candidate] (51.576 ms) : 0, 51576
Debugger [baseline] (5.952 ms) : 0, 5952
Debugger [candidate] (5.931 ms) : 0, 5931
Remote Config [baseline] (600.347 µs) : 0, 600
Remote Config [candidate] (600.98 µs) : 0, 601
Telemetry [baseline] (8.074 ms) : 0, 8074
Telemetry [candidate] (7.925 ms) : 0, 7925
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.51.0-SNAPSHOT~b2e8d4e670, baseline=1.51.0-SNAPSHOT~aa9dd27535
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.025 s) : 0, 1025370
Total [baseline] (10.587 s) : 0, 10587389
Agent [candidate] (1.026 s) : 0, 1025876
Total [candidate] (10.558 s) : 0, 10557831
section appsec
Agent [baseline] (1.179 s) : 0, 1178953
Total [baseline] (10.722 s) : 0, 10721684
Agent [candidate] (1.178 s) : 0, 1178354
Total [candidate] (10.703 s) : 0, 10702697
section iast
Agent [baseline] (1.151 s) : 0, 1151376
Total [baseline] (10.879 s) : 0, 10878813
Agent [candidate] (1.152 s) : 0, 1152300
Total [candidate] (10.953 s) : 0, 10953460
section profiling
Agent [baseline] (1.278 s) : 0, 1278027
Total [baseline] (10.885 s) : 0, 10885497
Agent [candidate] (1.27 s) : 0, 1270414
Total [candidate] (10.966 s) : 0, 10966034
gantt
title petclinic - break down per module: candidate=1.51.0-SNAPSHOT~b2e8d4e670, baseline=1.51.0-SNAPSHOT~aa9dd27535
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (685.336 ms) : 0, 685336
BytebuddyAgent [candidate] (685.59 ms) : 0, 685590
GlobalTracer [baseline] (242.133 ms) : 0, 242133
GlobalTracer [candidate] (242.307 ms) : 0, 242307
AppSec [baseline] (56.472 ms) : 0, 56472
AppSec [candidate] (59.232 ms) : 0, 59232
Debugger [baseline] (7.801 ms) : 0, 7801
Debugger [candidate] (6.22 ms) : 0, 6220
Remote Config [baseline] (675.037 µs) : 0, 675
Remote Config [candidate] (657.197 µs) : 0, 657
Telemetry [baseline] (12.105 ms) : 0, 12105
Telemetry [candidate] (10.997 ms) : 0, 10997
section appsec
BytebuddyAgent [baseline] (709.082 ms) : 0, 709082
BytebuddyAgent [candidate] (707.729 ms) : 0, 707729
GlobalTracer [baseline] (235.042 ms) : 0, 235042
GlobalTracer [candidate] (235.36 ms) : 0, 235360
IAST [baseline] (21.78 ms) : 0, 21780
IAST [candidate] (21.757 ms) : 0, 21757
AppSec [baseline] (178.719 ms) : 0, 178719
AppSec [candidate] (179.078 ms) : 0, 179078
Debugger [baseline] (5.751 ms) : 0, 5751
Debugger [candidate] (5.821 ms) : 0, 5821
Remote Config [baseline] (607.782 µs) : 0, 608
Remote Config [candidate] (615.962 µs) : 0, 616
Telemetry [baseline] (7.183 ms) : 0, 7183
Telemetry [candidate] (7.24 ms) : 0, 7240
section iast
BytebuddyAgent [baseline] (805.83 ms) : 0, 805830
BytebuddyAgent [candidate] (806.27 ms) : 0, 806270
GlobalTracer [baseline] (231.596 ms) : 0, 231596
GlobalTracer [candidate] (231.722 ms) : 0, 231722
IAST [baseline] (29.763 ms) : 0, 29763
IAST [candidate] (27.486 ms) : 0, 27486
AppSec [baseline] (48.933 ms) : 0, 48933
AppSec [candidate] (51.371 ms) : 0, 51371
Debugger [baseline] (5.941 ms) : 0, 5941
Debugger [candidate] (5.925 ms) : 0, 5925
Remote Config [baseline] (617.374 µs) : 0, 617
Remote Config [candidate] (608.132 µs) : 0, 608
Telemetry [baseline] (7.947 ms) : 0, 7947
Telemetry [candidate] (8.008 ms) : 0, 8008
section profiling
BytebuddyAgent [baseline] (681.975 ms) : 0, 681975
BytebuddyAgent [candidate] (678.44 ms) : 0, 678440
GlobalTracer [baseline] (362.853 ms) : 0, 362853
GlobalTracer [candidate] (360.666 ms) : 0, 360666
AppSec [baseline] (62.389 ms) : 0, 62389
AppSec [candidate] (62.063 ms) : 0, 62063
Debugger [baseline] (6.18 ms) : 0, 6180
Debugger [candidate] (6.14 ms) : 0, 6140
Remote Config [baseline] (713.152 µs) : 0, 713
Remote Config [candidate] (704.086 µs) : 0, 704
Telemetry [baseline] (8.138 ms) : 0, 8138
Telemetry [candidate] (8.142 ms) : 0, 8142
ProfilingAgent [baseline] (106.764 ms) : 0, 106764
ProfilingAgent [candidate] (105.558 ms) : 0, 105558
Profiling [baseline] (106.79 ms) : 0, 106790
Profiling [candidate] (105.583 ms) : 0, 105583
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 2 performance regressions! Performance is the same for 8 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~b2e8d4e670, baseline=1.51.0-SNAPSHOT~aa9dd27535
dateFormat X
axisFormat %s
section baseline
no_agent (4.4 ms) : 4351, 4449
. : milestone, 4400,
iast (9.284 ms) : 9130, 9439
. : milestone, 9284,
iast_FULL (14.005 ms) : 13731, 14278
. : milestone, 14005,
iast_GLOBAL (10.351 ms) : 10165, 10537
. : milestone, 10351,
profiling (8.688 ms) : 8557, 8819
. : milestone, 8688,
tracing (7.534 ms) : 7422, 7646
. : milestone, 7534,
section candidate
no_agent (4.605 ms) : 4552, 4657
. : milestone, 4605,
iast (9.038 ms) : 8892, 9184
. : milestone, 9038,
iast_FULL (14.416 ms) : 14121, 14710
. : milestone, 14416,
iast_GLOBAL (10.28 ms) : 10088, 10472
. : milestone, 10280,
profiling (8.861 ms) : 8724, 8998
. : milestone, 8861,
tracing (7.875 ms) : 7752, 7997
. : milestone, 7875,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~b2e8d4e670, baseline=1.51.0-SNAPSHOT~aa9dd27535
dateFormat X
axisFormat %s
section baseline
no_agent (37.394 ms) : 37094, 37695
. : milestone, 37394,
appsec (50.645 ms) : 50190, 51101
. : milestone, 50645,
code_origins (44.803 ms) : 44417, 45190
. : milestone, 44803,
iast (43.082 ms) : 42714, 43450
. : milestone, 43082,
profiling (51.051 ms) : 50531, 51570
. : milestone, 51051,
tracing (44.075 ms) : 43712, 44438
. : milestone, 44075,
section candidate
no_agent (37.477 ms) : 37170, 37784
. : milestone, 37477,
appsec (45.738 ms) : 45350, 46127
. : milestone, 45738,
code_origins (45.296 ms) : 44936, 45656
. : milestone, 45296,
iast (44.294 ms) : 43908, 44680
. : milestone, 44294,
profiling (49.371 ms) : 48908, 49834
. : milestone, 49371,
tracing (45.288 ms) : 44911, 45664
. : milestone, 45288,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~b2e8d4e670, baseline=1.51.0-SNAPSHOT~aa9dd27535
dateFormat X
axisFormat %s
section baseline
no_agent (14.838 s) : 14838000, 14838000
. : milestone, 14838000,
appsec (14.952 s) : 14952000, 14952000
. : milestone, 14952000,
iast (18.909 s) : 18909000, 18909000
. : milestone, 18909000,
iast_GLOBAL (17.987 s) : 17987000, 17987000
. : milestone, 17987000,
profiling (15.303 s) : 15303000, 15303000
. : milestone, 15303000,
tracing (15.037 s) : 15037000, 15037000
. : milestone, 15037000,
section candidate
no_agent (15.421 s) : 15421000, 15421000
. : milestone, 15421000,
appsec (14.786 s) : 14786000, 14786000
. : milestone, 14786000,
iast (18.741 s) : 18741000, 18741000
. : milestone, 18741000,
iast_GLOBAL (18.095 s) : 18095000, 18095000
. : milestone, 18095000,
profiling (15.199 s) : 15199000, 15199000
. : milestone, 15199000,
tracing (15.157 s) : 15157000, 15157000
. : milestone, 15157000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~b2e8d4e670, baseline=1.51.0-SNAPSHOT~aa9dd27535
dateFormat X
axisFormat %s
section baseline
no_agent (1.487 ms) : 1476, 1499
. : milestone, 1487,
appsec (2.434 ms) : 2384, 2484
. : milestone, 2434,
iast (2.204 ms) : 2142, 2266
. : milestone, 2204,
iast_GLOBAL (2.242 ms) : 2179, 2304
. : milestone, 2242,
profiling (2.069 ms) : 2018, 2120
. : milestone, 2069,
tracing (2.047 ms) : 1998, 2095
. : milestone, 2047,
section candidate
no_agent (1.479 ms) : 1468, 1491
. : milestone, 1479,
appsec (2.423 ms) : 2373, 2472
. : milestone, 2423,
iast (2.212 ms) : 2150, 2274
. : milestone, 2212,
iast_GLOBAL (2.246 ms) : 2183, 2309
. : milestone, 2246,
profiling (2.078 ms) : 2027, 2129
. : milestone, 2078,
tracing (2.038 ms) : 1989, 2086
. : milestone, 2038,
|
@@ -225,6 +225,7 @@ tasks.register('extractLatestMuleServices', Sync) { | |||
// build the mule application via maven | |||
tasks.register('mvnPackage', Exec) { | |||
workingDir "$appDir" | |||
environment.JAVA_HOME = System.getenv("JAVA_8_HOME") |
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.
suggestion: Wouldn't be better to derive this env var from the toolchain API ?
Same for the other similar changes.
apply from: "$rootDir/gradle/java.gradle" | ||
apply from: "$rootDir/gradle/tries.gradle" | ||
|
||
tasks.compileTestJava.configure { | ||
tasks.withType(JavaCompile).configureEach { | ||
// need access to sun.misc.SharedSecrets |
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.
suggestion:
// need access to sun.misc.SharedSecrets | |
// Need access to sun.misc.SharedSecrets, which moved to a restricted jdk module in later JDKs |
def skipSettingCompilerRelease = project.findProperty('skipSettingCompilerRelease') | ||
if (!skipSettingCompilerRelease && JavaVersion.current().isJava9Compatible()) { | ||
compileJava.options.release = project.provider { | ||
JavaVersion.toVersion(targetCompatibility).majorVersion as Integer | ||
} | ||
} |
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.
suggestion: I'd suggest to keep this behavior via ext.setJavaVersion
, dropping the flag skipSettingCompilerRelease
and just use the release
options if JDK >= 9.
Possible the setJavaVersion
, can have a flag or enum that could be used to explicitly use the source and target rather than option, e.g. for the profiling project to access jfr.
fork.executable = javaLauncher.executablePath | ||
} | ||
if (!this.javaVersion) { | ||
this.javaVersion = "8" |
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.
suggestion: Maybe extract "8"
to some variable indicating the agent version.
Another suggestion: wouldn't be better to set 8 as a default value in MuzzleDirective.javaVersion
?
workQueue = workerExecutor.processIsolation { spec -> | ||
spec.forkOptions { fork -> | ||
fork.executable = javaLauncher.executablePath | ||
} | ||
} else { | ||
workQueue = workerExecutor.noIsolation() |
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.
note: After some diving, the ClassLoader.systemClassLoader()
in workerExecutor.processIsolation(...)
work queue appears to have quite a few jars from the gradle distribution — 165 on minimal reproducer project with gradle 8.14.2 — on the classpath.
Among them httpclient 4.5.13, which may explains why some muzzle tests (like :dd-java-agent:instrumentation:apache-httpclient-4:muzzle-AssertFail-commons-httpclient-commons-httpclient-3.1
) are succeeding instead of failing. These are checking that dependencies outside this range [4.0,5)
do not match, but during lookup class of the httpclient are seen on the classpath.
This does not happen when the work queue executor workerExecutor.noIsolation()
was used. It was used when the javaVersion
was not explictly set via the coreJdk()
muzzle directive. In fact in this mode the ClassLoader.systemCLassLoader()
shows only two gradle jars, the gradle launcher and the instrumentation agent.
We may want to improve the situation there, as it renders the tests brittle even if they appear to rightfully pass.
For this PR, which is about decoupling the JDK running gradle from the target JDK (8 at this time), we may possibly run this in the JVM that runs gradle because muzzle is about detecting whether a dependency is still covered by an instrumentation and as such tries to detect types / "outlines".
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.
By the way, here's how to debug,
-
First select only one version that fails, e.g. the directive that is failing is
pass
with a rangeassertInverse
(this will assess that opposite range will fail), so we need a directive expected to fail for a single version, e.g. here expect 3.1 to fail.muzzle { - fail { - group = "commons-httpclient" - module = "commons-httpclient" - versions = "[,4.0)" - skipVersions += '3.1-jenkins-1' - skipVersions += '2.0-final' // broken metadata on maven central - } - pass { - group = "org.apache.httpcomponents" - module = "httpclient" - versions = "[4.0,5)" - assertInverse = true - } - pass { - // We want to support the dropwizard clients too. - group = 'io.dropwizard' - module = 'dropwizard-client' - versions = "[,3)" // dropwizard-client 3+ uses httpclient5 - } + fail { + group = "commons-httpclient" + module = "commons-httpclient" + versions = "[3.1,]" + } }
This is necessary because the task
:dd-java-agent:instrumentation:apache-httpclient-4:muzzle-AssertFail-commons-httpclient-commons-httpclient-3.1
is created after invokingmuzzle
, and as such cannot be invoked directly. -
Make the worker daemon debuggable since it's another process
workQueue = workerExecutor.processIsolation { spec -> spec.forkOptions { fork -> fork.executable = javaLauncher.executablePath + fork.debug = true } }
-
Then run/debug the muzzle task
:dd-java-agent:instrumentation:apache-httpclient-4:muzzle
. -
When the daemon work prints it's listening for a debugger, just create a Remote JVM Debug config in Intellij in Attach to remote JVM debugger mode. Other settings are untouched (port in 5005). No need to add the command line arg to the forked process !
What Does This Do
Use JDK 8 by default, explicitly, to allow running gradle with newer JDKs.
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: APMJAVA-1342