Avoid feature discover and java.nio.* access in Bazel Mode#11232
Avoid feature discover and java.nio.* access in Bazel Mode#11232daniel-mohedano wants to merge 3 commits intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40d7a0b9eb
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| DDAgentFeaturesDiscovery featuresDiscovery; | ||
| if (payloadFilesEnabled) { | ||
| featuresDiscovery = null; |
There was a problem hiding this comment.
Bypass data streams discovery in payload-files mode
When CI Visibility payload-files mode is enabled with the default tracer builder, setting this local featuresDiscovery to null does not actually avoid probing the agent: the constructor continues to create DefaultDataStreamsMonitoring, whose constructor unconditionally calls sharedCommunicationObjects.featuresDiscovery(config) in dd-trace-core/src/main/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoring.java:105 before data streams are conditionally registered. Hermetic Bazel runs will still create/schedule feature discovery as soon as the tracer starts, so payload-files mode needs to bypass that default data-streams initialization or use a no-op there too.
Useful? React with 👍 / 👎.
| if (!tmp.renameTo(target)) { | ||
| tmp.delete(); |
There was a problem hiding this comment.
this swallows failures - just in case you need to log this as well
| featuresDiscovery.discoverIfOutdated(); | ||
| DDAgentFeaturesDiscovery featuresDiscovery; | ||
| if (payloadFilesEnabled) { | ||
| featuresDiscovery = null; |
There was a problem hiding this comment.
This might be a bit fragile to set this to null - have you considered introducing a NoopFeaturesDiscovery so that we never deal with null?
| try (BufferedReader reader = Files.newBufferedReader(manifestPath)) { | ||
| private static boolean isManifestCompatible(String manifestPath) { | ||
| try (BufferedReader reader = | ||
| new BufferedReader(new InputStreamReader(new FileInputStream(manifestPath), "UTF-8"))) { |
There was a problem hiding this comment.
using java.nio.charset.StandardCharsets.UTF_8 is acceptable
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 11 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.62.0-SNAPSHOT~1c44f5a398, baseline=1.62.0-SNAPSHOT~f551ff99c2
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1063707
Total [baseline] (8.835 s) : 0, 8835032
Agent [candidate] (1.063 s) : 0, 1063433
Total [candidate] (8.87 s) : 0, 8870418
section iast
Agent [baseline] (1.259 s) : 0, 1259341
Total [baseline] (9.572 s) : 0, 9572318
Agent [candidate] (1.255 s) : 0, 1254652
Total [candidate] (9.537 s) : 0, 9536564
gantt
title insecure-bank - break down per module: candidate=1.62.0-SNAPSHOT~1c44f5a398, baseline=1.62.0-SNAPSHOT~f551ff99c2
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.22 ms) : 0, 1220
crashtracking [candidate] (1.236 ms) : 0, 1236
BytebuddyAgent [baseline] (635.51 ms) : 0, 635510
BytebuddyAgent [candidate] (635.271 ms) : 0, 635271
AgentMeter [baseline] (29.394 ms) : 0, 29394
AgentMeter [candidate] (29.404 ms) : 0, 29404
GlobalTracer [baseline] (248.744 ms) : 0, 248744
GlobalTracer [candidate] (248.767 ms) : 0, 248767
AppSec [baseline] (32.787 ms) : 0, 32787
AppSec [candidate] (32.764 ms) : 0, 32764
Debugger [baseline] (60.518 ms) : 0, 60518
Debugger [candidate] (59.787 ms) : 0, 59787
Remote Config [baseline] (598.033 µs) : 0, 598
Remote Config [candidate] (601.585 µs) : 0, 602
Telemetry [baseline] (9.89 ms) : 0, 9890
Telemetry [candidate] (8.379 ms) : 0, 8379
Flare Poller [baseline] (9.053 ms) : 0, 9053
Flare Poller [candidate] (11.293 ms) : 0, 11293
section iast
crashtracking [baseline] (1.249 ms) : 0, 1249
crashtracking [candidate] (1.227 ms) : 0, 1227
BytebuddyAgent [baseline] (836.755 ms) : 0, 836755
BytebuddyAgent [candidate] (831.468 ms) : 0, 831468
AgentMeter [baseline] (11.47 ms) : 0, 11470
AgentMeter [candidate] (11.416 ms) : 0, 11416
GlobalTracer [baseline] (239.694 ms) : 0, 239694
GlobalTracer [candidate] (239.687 ms) : 0, 239687
AppSec [baseline] (30.97 ms) : 0, 30970
AppSec [candidate] (31.859 ms) : 0, 31859
Debugger [baseline] (63.668 ms) : 0, 63668
Debugger [candidate] (62.573 ms) : 0, 62573
Remote Config [baseline] (539.356 µs) : 0, 539
Remote Config [candidate] (528.843 µs) : 0, 529
Telemetry [baseline] (7.932 ms) : 0, 7932
Telemetry [candidate] (7.909 ms) : 0, 7909
Flare Poller [baseline] (3.384 ms) : 0, 3384
Flare Poller [candidate] (3.31 ms) : 0, 3310
IAST [baseline] (27.428 ms) : 0, 27428
IAST [candidate] (28.493 ms) : 0, 28493
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.62.0-SNAPSHOT~1c44f5a398, baseline=1.62.0-SNAPSHOT~f551ff99c2
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.073 s) : 0, 1073113
Total [baseline] (11.05 s) : 0, 11049527
Agent [candidate] (1.074 s) : 0, 1074040
Total [candidate] (11.033 s) : 0, 11032865
section appsec
Agent [baseline] (1.269 s) : 0, 1269087
Total [baseline] (11.117 s) : 0, 11116867
Agent [candidate] (1.271 s) : 0, 1270757
Total [candidate] (11.139 s) : 0, 11139258
section iast
Agent [baseline] (1.246 s) : 0, 1246247
Total [baseline] (11.415 s) : 0, 11415294
Agent [candidate] (1.252 s) : 0, 1252431
Total [candidate] (11.296 s) : 0, 11295651
section profiling
Agent [baseline] (1.191 s) : 0, 1191224
Total [baseline] (10.956 s) : 0, 10956035
Agent [candidate] (1.194 s) : 0, 1193716
Total [candidate] (11.095 s) : 0, 11095457
gantt
title petclinic - break down per module: candidate=1.62.0-SNAPSHOT~1c44f5a398, baseline=1.62.0-SNAPSHOT~f551ff99c2
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.232 ms) : 0, 1232
crashtracking [candidate] (1.244 ms) : 0, 1244
BytebuddyAgent [baseline] (640.904 ms) : 0, 640904
BytebuddyAgent [candidate] (641.676 ms) : 0, 641676
AgentMeter [baseline] (29.666 ms) : 0, 29666
AgentMeter [candidate] (29.823 ms) : 0, 29823
GlobalTracer [baseline] (250.954 ms) : 0, 250954
GlobalTracer [candidate] (251.625 ms) : 0, 251625
AppSec [baseline] (33.121 ms) : 0, 33121
AppSec [candidate] (33.098 ms) : 0, 33098
Debugger [baseline] (60.728 ms) : 0, 60728
Debugger [candidate] (60.701 ms) : 0, 60701
Remote Config [baseline] (606.495 µs) : 0, 606
Remote Config [candidate] (602.251 µs) : 0, 602
Telemetry [baseline] (9.158 ms) : 0, 9158
Telemetry [candidate] (9.243 ms) : 0, 9243
Flare Poller [baseline] (10.558 ms) : 0, 10558
Flare Poller [candidate] (9.845 ms) : 0, 9845
section appsec
crashtracking [baseline] (1.227 ms) : 0, 1227
crashtracking [candidate] (1.222 ms) : 0, 1222
BytebuddyAgent [baseline] (675.117 ms) : 0, 675117
BytebuddyAgent [candidate] (677.099 ms) : 0, 677099
AgentMeter [baseline] (12.27 ms) : 0, 12270
AgentMeter [candidate] (12.329 ms) : 0, 12329
GlobalTracer [baseline] (250.586 ms) : 0, 250586
GlobalTracer [candidate] (250.532 ms) : 0, 250532
AppSec [baseline] (186.103 ms) : 0, 186103
AppSec [candidate] (185.655 ms) : 0, 185655
Debugger [baseline] (65.174 ms) : 0, 65174
Debugger [candidate] (65.415 ms) : 0, 65415
Remote Config [baseline] (569.165 µs) : 0, 569
Remote Config [candidate] (568.607 µs) : 0, 569
Telemetry [baseline] (7.909 ms) : 0, 7909
Telemetry [candidate] (7.892 ms) : 0, 7892
Flare Poller [baseline] (7.913 ms) : 0, 7913
Flare Poller [candidate] (7.429 ms) : 0, 7429
IAST [baseline] (24.964 ms) : 0, 24964
IAST [candidate] (24.726 ms) : 0, 24726
section iast
crashtracking [baseline] (1.22 ms) : 0, 1220
crashtracking [candidate] (1.24 ms) : 0, 1240
BytebuddyAgent [baseline] (824.496 ms) : 0, 824496
BytebuddyAgent [candidate] (826.393 ms) : 0, 826393
AgentMeter [baseline] (11.321 ms) : 0, 11321
AgentMeter [candidate] (11.434 ms) : 0, 11434
GlobalTracer [baseline] (238.12 ms) : 0, 238120
GlobalTracer [candidate] (239.386 ms) : 0, 239386
AppSec [baseline] (32.307 ms) : 0, 32307
AppSec [candidate] (32.84 ms) : 0, 32840
Debugger [baseline] (63.254 ms) : 0, 63254
Debugger [candidate] (64.56 ms) : 0, 64560
Remote Config [baseline] (522.729 µs) : 0, 523
Remote Config [candidate] (534.037 µs) : 0, 534
Telemetry [baseline] (7.973 ms) : 0, 7973
Telemetry [candidate] (8.212 ms) : 0, 8212
Flare Poller [baseline] (3.408 ms) : 0, 3408
Flare Poller [candidate] (3.524 ms) : 0, 3524
IAST [baseline] (27.516 ms) : 0, 27516
IAST [candidate] (28.076 ms) : 0, 28076
section profiling
ProfilingAgent [baseline] (94.023 ms) : 0, 94023
ProfilingAgent [candidate] (94.112 ms) : 0, 94112
crashtracking [baseline] (1.19 ms) : 0, 1190
crashtracking [candidate] (1.173 ms) : 0, 1173
BytebuddyAgent [baseline] (695.084 ms) : 0, 695084
BytebuddyAgent [candidate] (697.132 ms) : 0, 697132
AgentMeter [baseline] (8.951 ms) : 0, 8951
AgentMeter [candidate] (9.013 ms) : 0, 9013
GlobalTracer [baseline] (208.855 ms) : 0, 208855
GlobalTracer [candidate] (209.207 ms) : 0, 209207
AppSec [baseline] (32.956 ms) : 0, 32956
AppSec [candidate] (32.938 ms) : 0, 32938
Debugger [baseline] (66.189 ms) : 0, 66189
Debugger [candidate] (66.171 ms) : 0, 66171
Remote Config [baseline] (572.058 µs) : 0, 572
Remote Config [candidate] (567.882 µs) : 0, 568
Telemetry [baseline] (8.183 ms) : 0, 8183
Telemetry [candidate] (8.003 ms) : 0, 8003
Flare Poller [baseline] (3.577 ms) : 0, 3577
Flare Poller [candidate] (3.515 ms) : 0, 3515
Profiling [baseline] (94.578 ms) : 0, 94578
Profiling [candidate] (94.665 ms) : 0, 94665
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 3 performance regressions! Performance is the same for 18 metrics, 15 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~1c44f5a398, baseline=1.62.0-SNAPSHOT~f551ff99c2
dateFormat X
axisFormat %s
section baseline
no_agent (19.874 ms) : 19675, 20074
. : milestone, 19874,
appsec (18.83 ms) : 18644, 19016
. : milestone, 18830,
code_origins (18.256 ms) : 18075, 18437
. : milestone, 18256,
iast (17.748 ms) : 17575, 17922
. : milestone, 17748,
profiling (18.307 ms) : 18125, 18490
. : milestone, 18307,
tracing (17.62 ms) : 17447, 17794
. : milestone, 17620,
section candidate
no_agent (19.422 ms) : 19230, 19615
. : milestone, 19422,
appsec (18.79 ms) : 18599, 18981
. : milestone, 18790,
code_origins (17.969 ms) : 17794, 18145
. : milestone, 17969,
iast (17.887 ms) : 17706, 18068
. : milestone, 17887,
profiling (18.264 ms) : 18077, 18452
. : milestone, 18264,
tracing (17.865 ms) : 17691, 18039
. : milestone, 17865,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~1c44f5a398, baseline=1.62.0-SNAPSHOT~f551ff99c2
dateFormat X
axisFormat %s
section baseline
no_agent (1.266 ms) : 1253, 1279
. : milestone, 1266,
iast (3.295 ms) : 3250, 3340
. : milestone, 3295,
iast_FULL (6.102 ms) : 6039, 6164
. : milestone, 6102,
iast_GLOBAL (3.601 ms) : 3545, 3657
. : milestone, 3601,
profiling (2.068 ms) : 2050, 2086
. : milestone, 2068,
tracing (1.862 ms) : 1847, 1878
. : milestone, 1862,
section candidate
no_agent (1.247 ms) : 1234, 1259
. : milestone, 1247,
iast (3.427 ms) : 3380, 3474
. : milestone, 3427,
iast_FULL (6.049 ms) : 5987, 6111
. : milestone, 6049,
iast_GLOBAL (3.764 ms) : 3702, 3826
. : milestone, 3764,
profiling (2.166 ms) : 2146, 2186
. : milestone, 2166,
tracing (1.899 ms) : 1883, 1915
. : milestone, 1899,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~1c44f5a398, baseline=1.62.0-SNAPSHOT~f551ff99c2
dateFormat X
axisFormat %s
section baseline
no_agent (15.327 s) : 15327000, 15327000
. : milestone, 15327000,
appsec (14.861 s) : 14861000, 14861000
. : milestone, 14861000,
iast (18.55 s) : 18550000, 18550000
. : milestone, 18550000,
iast_GLOBAL (18.018 s) : 18018000, 18018000
. : milestone, 18018000,
profiling (14.98 s) : 14980000, 14980000
. : milestone, 14980000,
tracing (14.993 s) : 14993000, 14993000
. : milestone, 14993000,
section candidate
no_agent (15.306 s) : 15306000, 15306000
. : milestone, 15306000,
appsec (14.445 s) : 14445000, 14445000
. : milestone, 14445000,
iast (18.578 s) : 18578000, 18578000
. : milestone, 18578000,
iast_GLOBAL (17.848 s) : 17848000, 17848000
. : milestone, 17848000,
profiling (15.091 s) : 15091000, 15091000
. : milestone, 15091000,
tracing (14.88 s) : 14880000, 14880000
. : milestone, 14880000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~1c44f5a398, baseline=1.62.0-SNAPSHOT~f551ff99c2
dateFormat X
axisFormat %s
section baseline
no_agent (1.499 ms) : 1487, 1510
. : milestone, 1499,
appsec (2.567 ms) : 2511, 2623
. : milestone, 2567,
iast (2.297 ms) : 2226, 2368
. : milestone, 2297,
iast_GLOBAL (2.343 ms) : 2272, 2415
. : milestone, 2343,
profiling (2.126 ms) : 2070, 2182
. : milestone, 2126,
tracing (2.105 ms) : 2051, 2160
. : milestone, 2105,
section candidate
no_agent (1.498 ms) : 1486, 1509
. : milestone, 1498,
appsec (3.867 ms) : 3643, 4092
. : milestone, 3867,
iast (2.305 ms) : 2233, 2376
. : milestone, 2305,
iast_GLOBAL (2.343 ms) : 2272, 2414
. : milestone, 2343,
profiling (2.108 ms) : 2053, 2164
. : milestone, 2108,
tracing (2.091 ms) : 2037, 2145
. : milestone, 2091,
|
What Does This Do
java.nio.*classes during pre-main through the bazel mode resolution.Additional Notes
test-environment-trigger: skip
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 issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.