-
Notifications
You must be signed in to change notification settings - Fork 318
Safely handle Files.exist on discovery and config when a Security Manager is present #10009
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
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 5 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.57.0-SNAPSHOT~fd8b3e96d7, baseline=1.57.0-SNAPSHOT~6b32bddf07
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.123 s) : 0, 1123448
Total [baseline] (11.004 s) : 0, 11004386
Agent [candidate] (1.104 s) : 0, 1103799
Total [candidate] (10.928 s) : 0, 10928276
section appsec
Agent [baseline] (1.29 s) : 0, 1290059
Total [baseline] (11.128 s) : 0, 11128069
Agent [candidate] (1.296 s) : 0, 1296183
Total [candidate] (11.226 s) : 0, 11226122
section iast
Agent [baseline] (1.244 s) : 0, 1243819
Total [baseline] (11.301 s) : 0, 11300706
Agent [candidate] (1.246 s) : 0, 1245552
Total [candidate] (11.326 s) : 0, 11325597
section profiling
Agent [baseline] (1.242 s) : 0, 1241811
Total [baseline] (11.316 s) : 0, 11315549
Agent [candidate] (1.234 s) : 0, 1234072
Total [candidate] (11.155 s) : 0, 11155447
gantt
title petclinic - break down per module: candidate=1.57.0-SNAPSHOT~fd8b3e96d7, baseline=1.57.0-SNAPSHOT~6b32bddf07
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.516 ms) : 0, 1516
crashtracking [candidate] (1.501 ms) : 0, 1501
BytebuddyAgent [baseline] (720.752 ms) : 0, 720752
BytebuddyAgent [candidate] (708.78 ms) : 0, 708780
GlobalTracer [baseline] (254.43 ms) : 0, 254430
GlobalTracer [candidate] (249.788 ms) : 0, 249788
AppSec [baseline] (33.098 ms) : 0, 33098
AppSec [candidate] (31.922 ms) : 0, 31922
Debugger [baseline] (65.489 ms) : 0, 65489
Debugger [candidate] (64.283 ms) : 0, 64283
Remote Config [baseline] (645.275 µs) : 0, 645
Remote Config [candidate] (626.169 µs) : 0, 626
Telemetry [baseline] (8.41 ms) : 0, 8410
Telemetry [candidate] (8.326 ms) : 0, 8326
Flare Poller [baseline] (3.796 ms) : 0, 3796
Flare Poller [candidate] (3.762 ms) : 0, 3762
section appsec
crashtracking [baseline] (1.501 ms) : 0, 1501
crashtracking [candidate] (1.517 ms) : 0, 1517
BytebuddyAgent [baseline] (735.103 ms) : 0, 735103
BytebuddyAgent [candidate] (739.903 ms) : 0, 739903
GlobalTracer [baseline] (242.575 ms) : 0, 242575
GlobalTracer [candidate] (243.444 ms) : 0, 243444
AppSec [baseline] (175.924 ms) : 0, 175924
AppSec [candidate] (175.8 ms) : 0, 175800
Debugger [baseline] (61.825 ms) : 0, 61825
Debugger [candidate] (62.263 ms) : 0, 62263
Remote Config [baseline] (676.813 µs) : 0, 677
Remote Config [candidate] (675.785 µs) : 0, 676
Telemetry [baseline] (8.267 ms) : 0, 8267
Telemetry [candidate] (8.444 ms) : 0, 8444
Flare Poller [baseline] (3.962 ms) : 0, 3962
Flare Poller [candidate] (3.931 ms) : 0, 3931
IAST [baseline] (25.185 ms) : 0, 25185
IAST [candidate] (25.056 ms) : 0, 25056
section iast
crashtracking [baseline] (1.486 ms) : 0, 1486
crashtracking [candidate] (1.502 ms) : 0, 1502
BytebuddyAgent [baseline] (835.363 ms) : 0, 835363
BytebuddyAgent [candidate] (835.446 ms) : 0, 835446
GlobalTracer [baseline] (238.385 ms) : 0, 238385
GlobalTracer [candidate] (239.128 ms) : 0, 239128
AppSec [baseline] (32.204 ms) : 0, 32204
AppSec [candidate] (33.41 ms) : 0, 33410
Debugger [baseline] (60.504 ms) : 0, 60504
Debugger [candidate] (60.881 ms) : 0, 60881
Remote Config [baseline] (538.8 µs) : 0, 539
Remote Config [candidate] (536.12 µs) : 0, 536
Telemetry [baseline] (7.611 ms) : 0, 7611
Telemetry [candidate] (7.678 ms) : 0, 7678
Flare Poller [baseline] (3.501 ms) : 0, 3501
Flare Poller [candidate] (3.528 ms) : 0, 3528
IAST [baseline] (29.267 ms) : 0, 29267
IAST [candidate] (28.517 ms) : 0, 28517
section profiling
ProfilingAgent [baseline] (98.43 ms) : 0, 98430
ProfilingAgent [candidate] (96.766 ms) : 0, 96766
crashtracking [baseline] (1.465 ms) : 0, 1465
crashtracking [candidate] (1.439 ms) : 0, 1439
BytebuddyAgent [baseline] (740.437 ms) : 0, 740437
BytebuddyAgent [candidate] (735.932 ms) : 0, 735932
GlobalTracer [baseline] (223.484 ms) : 0, 223484
GlobalTracer [candidate] (223.347 ms) : 0, 223347
AppSec [baseline] (32.483 ms) : 0, 32483
AppSec [candidate] (31.929 ms) : 0, 31929
Debugger [baseline] (63.495 ms) : 0, 63495
Debugger [candidate] (62.988 ms) : 0, 62988
Remote Config [baseline] (648.71 µs) : 0, 649
Remote Config [candidate] (654.644 µs) : 0, 655
Telemetry [baseline] (8.001 ms) : 0, 8001
Telemetry [candidate] (8.063 ms) : 0, 8063
Flare Poller [baseline] (3.787 ms) : 0, 3787
Flare Poller [candidate] (3.825 ms) : 0, 3825
Profiling [baseline] (99.045 ms) : 0, 99045
Profiling [candidate] (97.35 ms) : 0, 97350
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.57.0-SNAPSHOT~fd8b3e96d7, baseline=1.57.0-SNAPSHOT~6b32bddf07
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.102 s) : 0, 1101706
Total [baseline] (8.875 s) : 0, 8874949
Agent [candidate] (1.102 s) : 0, 1102119
Total [candidate] (8.858 s) : 0, 8857607
section iast
Agent [baseline] (1.247 s) : 0, 1247379
Total [baseline] (9.592 s) : 0, 9591765
Agent [candidate] (1.247 s) : 0, 1247248
Total [candidate] (9.58 s) : 0, 9579992
gantt
title insecure-bank - break down per module: candidate=1.57.0-SNAPSHOT~fd8b3e96d7, baseline=1.57.0-SNAPSHOT~6b32bddf07
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.526 ms) : 0, 1526
crashtracking [candidate] (1.487 ms) : 0, 1487
BytebuddyAgent [baseline] (707.268 ms) : 0, 707268
BytebuddyAgent [candidate] (708.536 ms) : 0, 708536
GlobalTracer [baseline] (249.836 ms) : 0, 249836
GlobalTracer [candidate] (249.385 ms) : 0, 249385
AppSec [baseline] (32.109 ms) : 0, 32109
AppSec [candidate] (31.954 ms) : 0, 31954
Debugger [baseline] (63.423 ms) : 0, 63423
Debugger [candidate] (63.265 ms) : 0, 63265
Remote Config [baseline] (644.287 µs) : 0, 644
Remote Config [candidate] (628.011 µs) : 0, 628
Telemetry [baseline] (8.271 ms) : 0, 8271
Telemetry [candidate] (8.288 ms) : 0, 8288
Flare Poller [baseline] (3.701 ms) : 0, 3701
Flare Poller [candidate] (3.728 ms) : 0, 3728
section iast
crashtracking [baseline] (1.506 ms) : 0, 1506
crashtracking [candidate] (1.491 ms) : 0, 1491
BytebuddyAgent [baseline] (839.313 ms) : 0, 839313
BytebuddyAgent [candidate] (838.869 ms) : 0, 838869
GlobalTracer [baseline] (238.13 ms) : 0, 238130
GlobalTracer [candidate] (239.182 ms) : 0, 239182
IAST [baseline] (29.122 ms) : 0, 29122
IAST [candidate] (28.848 ms) : 0, 28848
AppSec [baseline] (32.426 ms) : 0, 32426
AppSec [candidate] (32.371 ms) : 0, 32371
Debugger [baseline] (60.207 ms) : 0, 60207
Debugger [candidate] (59.814 ms) : 0, 59814
Remote Config [baseline] (538.365 µs) : 0, 538
Remote Config [candidate] (535.533 µs) : 0, 536
Telemetry [baseline] (7.578 ms) : 0, 7578
Telemetry [candidate] (7.561 ms) : 0, 7561
Flare Poller [baseline] (3.48 ms) : 0, 3480
Flare Poller [candidate] (3.42 ms) : 0, 3420
LoadParameters
See matching parameters
SummaryFound 3 performance improvements and 2 performance regressions! Performance is the same for 15 metrics, 16 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~fd8b3e96d7, baseline=1.57.0-SNAPSHOT~6b32bddf07
dateFormat X
axisFormat %s
section baseline
no_agent (19.078 ms) : 18883, 19272
. : milestone, 19078,
appsec (19.858 ms) : 19656, 20061
. : milestone, 19858,
code_origins (17.529 ms) : 17358, 17700
. : milestone, 17529,
iast (17.714 ms) : 17539, 17889
. : milestone, 17714,
profiling (19.462 ms) : 19266, 19657
. : milestone, 19462,
tracing (18.088 ms) : 17906, 18270
. : milestone, 18088,
section candidate
no_agent (18.143 ms) : 17959, 18327
. : milestone, 18143,
appsec (18.627 ms) : 18437, 18816
. : milestone, 18627,
code_origins (18.759 ms) : 18571, 18948
. : milestone, 18759,
iast (17.669 ms) : 17498, 17841
. : milestone, 17669,
profiling (20.421 ms) : 20212, 20630
. : milestone, 20421,
tracing (17.614 ms) : 17438, 17790
. : milestone, 17614,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~fd8b3e96d7, baseline=1.57.0-SNAPSHOT~6b32bddf07
dateFormat X
axisFormat %s
section baseline
no_agent (1.201 ms) : 1189, 1212
. : milestone, 1201,
iast (3.151 ms) : 3111, 3191
. : milestone, 3151,
iast_FULL (5.637 ms) : 5580, 5693
. : milestone, 5637,
iast_GLOBAL (3.557 ms) : 3501, 3613
. : milestone, 3557,
profiling (2.071 ms) : 2051, 2090
. : milestone, 2071,
tracing (1.828 ms) : 1814, 1843
. : milestone, 1828,
section candidate
no_agent (1.203 ms) : 1192, 1215
. : milestone, 1203,
iast (3.156 ms) : 3116, 3195
. : milestone, 3156,
iast_FULL (5.754 ms) : 5697, 5812
. : milestone, 5754,
iast_GLOBAL (3.701 ms) : 3637, 3765
. : milestone, 3701,
profiling (1.902 ms) : 1887, 1917
. : milestone, 1902,
tracing (1.816 ms) : 1801, 1831
. : milestone, 1816,
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 tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~fd8b3e96d7, baseline=1.57.0-SNAPSHOT~6b32bddf07
dateFormat X
axisFormat %s
section baseline
no_agent (1.488 ms) : 1477, 1500
. : milestone, 1488,
appsec (3.675 ms) : 3458, 3893
. : milestone, 3675,
iast (2.236 ms) : 2171, 2302
. : milestone, 2236,
iast_GLOBAL (2.276 ms) : 2211, 2342
. : milestone, 2276,
profiling (2.105 ms) : 2051, 2160
. : milestone, 2105,
tracing (2.068 ms) : 2016, 2120
. : milestone, 2068,
section candidate
no_agent (1.489 ms) : 1478, 1501
. : milestone, 1489,
appsec (3.756 ms) : 3536, 3975
. : milestone, 3756,
iast (2.239 ms) : 2173, 2304
. : milestone, 2239,
iast_GLOBAL (2.275 ms) : 2210, 2341
. : milestone, 2275,
profiling (2.114 ms) : 2059, 2169
. : milestone, 2114,
tracing (2.076 ms) : 2025, 2128
. : milestone, 2076,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~fd8b3e96d7, baseline=1.57.0-SNAPSHOT~6b32bddf07
dateFormat X
axisFormat %s
section baseline
no_agent (15.652 s) : 15652000, 15652000
. : milestone, 15652000,
appsec (14.888 s) : 14888000, 14888000
. : milestone, 14888000,
iast (18.372 s) : 18372000, 18372000
. : milestone, 18372000,
iast_GLOBAL (17.847 s) : 17847000, 17847000
. : milestone, 17847000,
profiling (15.1 s) : 15100000, 15100000
. : milestone, 15100000,
tracing (14.844 s) : 14844000, 14844000
. : milestone, 14844000,
section candidate
no_agent (15.064 s) : 15064000, 15064000
. : milestone, 15064000,
appsec (14.972 s) : 14972000, 14972000
. : milestone, 14972000,
iast (18.35 s) : 18350000, 18350000
. : milestone, 18350000,
iast_GLOBAL (18.166 s) : 18166000, 18166000
. : milestone, 18166000,
profiling (14.923 s) : 14923000, 14923000
. : milestone, 14923000,
tracing (14.866 s) : 14866000, 14866000
. : milestone, 14866000,
|
PerfectSlayer
left a comment
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.
Thanks for the improvements. Left minor comments.
utils/filesystem-utils/src/main/java/datadog/common/filesystem/Files.java
Outdated
Show resolved
Hide resolved
utils/filesystem-utils/src/test/groovy/datadog/common/filesystem/FilesTest.groovy
Outdated
Show resolved
Hide resolved
utils/filesystem-utils/src/test/groovy/datadog/common/filesystem/FilesTest.groovy
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @Test | ||
| @DisabledIf("isJava18OrLater") |
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.
Minor nitpick, in our code base I can see @DisabledIf applied without using methods, for example:
@DisabledIf(
value = "datadog.environment.JavaVirtualMachine#isJ9",
disabledReason = "Bug in J9: no LocalVariableTable for ClassFileTransformer")
Is it possible to configure same way?
What Does This Do
This PR introduces a new
filesystemutility module. TheFilesclass provides a safe way to check for file existence, properly handlingSecurityExceptionwhen it occurs.The main motivation is to allow the agent to start under a SecurityManager while preserving as much functionality as possible. Previously, when starting the agent with APM disabled but JmxFetch enabled, JmxFetch could fail to start because its discovery process checked for file existence without catching
SecurityException, causing JmxFetch startup to break.Example exception:
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]