-
Notifications
You must be signed in to change notification settings - Fork 319
Avoid preferences lock file contention for tests due to spawned child processes #10083
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
Merged
AlexeyKuznetsov-DD
merged 13 commits into
master
from
bdu/change-preferences-dir-for-tests
Dec 8, 2025
Merged
Avoid preferences lock file contention for tests due to spawned child processes #10083
AlexeyKuznetsov-DD
merged 13 commits into
master
from
bdu/change-preferences-dir-for-tests
Dec 8, 2025
+66
−8
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AlexeyKuznetsov-DD
approved these changes
Dec 4, 2025
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 insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.57.0-SNAPSHOT~bc8489613b, baseline=1.57.0-SNAPSHOT~823cec6aa6
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.09 s) : 0, 1089580
Total [baseline] (8.788 s) : 0, 8788452
Agent [candidate] (1.091 s) : 0, 1090799
Total [candidate] (8.781 s) : 0, 8780989
section iast
Agent [baseline] (1.226 s) : 0, 1225568
Total [baseline] (9.487 s) : 0, 9486879
Agent [candidate] (1.226 s) : 0, 1226107
Total [candidate] (9.489 s) : 0, 9489417
gantt
title insecure-bank - break down per module: candidate=1.57.0-SNAPSHOT~bc8489613b, baseline=1.57.0-SNAPSHOT~823cec6aa6
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.208 ms) : 0, 1208
crashtracking [candidate] (1.206 ms) : 0, 1206
BytebuddyAgent [baseline] (653.55 ms) : 0, 653550
BytebuddyAgent [candidate] (656.897 ms) : 0, 656897
GlobalTracer [baseline] (284.543 ms) : 0, 284543
GlobalTracer [candidate] (283.986 ms) : 0, 283986
AppSec [baseline] (32.719 ms) : 0, 32719
AppSec [candidate] (32.592 ms) : 0, 32592
Debugger [baseline] (68.215 ms) : 0, 68215
Debugger [candidate] (67.054 ms) : 0, 67054
Remote Config [baseline] (640.755 µs) : 0, 641
Remote Config [candidate] (633.118 µs) : 0, 633
Telemetry [baseline] (9.108 ms) : 0, 9108
Telemetry [candidate] (8.852 ms) : 0, 8852
Flare Poller [baseline] (3.727 ms) : 0, 3727
Flare Poller [candidate] (3.662 ms) : 0, 3662
section iast
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.202 ms) : 0, 1202
BytebuddyAgent [baseline] (791.614 ms) : 0, 791614
BytebuddyAgent [candidate] (792.927 ms) : 0, 792927
GlobalTracer [baseline] (256.149 ms) : 0, 256149
GlobalTracer [candidate] (256.247 ms) : 0, 256247
IAST [baseline] (27.221 ms) : 0, 27221
IAST [candidate] (27.023 ms) : 0, 27023
AppSec [baseline] (35.724 ms) : 0, 35724
AppSec [candidate] (35.701 ms) : 0, 35701
Debugger [baseline] (65.7 ms) : 0, 65700
Debugger [candidate] (64.99 ms) : 0, 64990
Remote Config [baseline] (547.248 µs) : 0, 547
Remote Config [candidate] (546.704 µs) : 0, 547
Telemetry [baseline] (8.441 ms) : 0, 8441
Telemetry [candidate] (8.442 ms) : 0, 8442
Flare Poller [baseline] (3.454 ms) : 0, 3454
Flare Poller [candidate] (3.486 ms) : 0, 3486
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.57.0-SNAPSHOT~bc8489613b, baseline=1.57.0-SNAPSHOT~823cec6aa6
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.083 s) : 0, 1082913
Total [baseline] (10.826 s) : 0, 10825672
Agent [candidate] (1.083 s) : 0, 1083124
Total [candidate] (10.843 s) : 0, 10842734
section appsec
Agent [baseline] (1.268 s) : 0, 1267885
Total [baseline] (11.179 s) : 0, 11179176
Agent [candidate] (1.278 s) : 0, 1277846
Total [candidate] (11.223 s) : 0, 11223418
section iast
Agent [baseline] (1.231 s) : 0, 1230995
Total [baseline] (11.301 s) : 0, 11301031
Agent [candidate] (1.225 s) : 0, 1225102
Total [candidate] (11.136 s) : 0, 11135914
section profiling
Agent [baseline] (1.218 s) : 0, 1218027
Total [baseline] (11.013 s) : 0, 11012760
Agent [candidate] (1.207 s) : 0, 1207062
Total [candidate] (11.144 s) : 0, 11144484
gantt
title petclinic - break down per module: candidate=1.57.0-SNAPSHOT~bc8489613b, baseline=1.57.0-SNAPSHOT~823cec6aa6
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.186 ms) : 0, 1186
crashtracking [candidate] (1.209 ms) : 0, 1209
BytebuddyAgent [baseline] (649.401 ms) : 0, 649401
BytebuddyAgent [candidate] (649.395 ms) : 0, 649395
GlobalTracer [baseline] (282.439 ms) : 0, 282439
GlobalTracer [candidate] (282.908 ms) : 0, 282908
AppSec [baseline] (32.401 ms) : 0, 32401
AppSec [candidate] (32.382 ms) : 0, 32382
Debugger [baseline] (68.431 ms) : 0, 68431
Debugger [candidate] (68.289 ms) : 0, 68289
Remote Config [baseline] (642.51 µs) : 0, 643
Remote Config [candidate] (635.337 µs) : 0, 635
Telemetry [baseline] (8.995 ms) : 0, 8995
Telemetry [candidate] (9.002 ms) : 0, 9002
Flare Poller [baseline] (3.69 ms) : 0, 3690
Flare Poller [candidate] (3.697 ms) : 0, 3697
section appsec
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.206 ms) : 0, 1206
BytebuddyAgent [baseline] (691.081 ms) : 0, 691081
BytebuddyAgent [candidate] (697.168 ms) : 0, 697168
GlobalTracer [baseline] (259.974 ms) : 0, 259974
GlobalTracer [candidate] (262.738 ms) : 0, 262738
IAST [baseline] (24.61 ms) : 0, 24610
IAST [candidate] (25.042 ms) : 0, 25042
AppSec [baseline] (175.594 ms) : 0, 175594
AppSec [candidate] (175.019 ms) : 0, 175019
Debugger [baseline] (66.226 ms) : 0, 66226
Debugger [candidate] (67.326 ms) : 0, 67326
Remote Config [baseline] (698.67 µs) : 0, 699
Remote Config [candidate] (694.824 µs) : 0, 695
Telemetry [baseline] (8.98 ms) : 0, 8980
Telemetry [candidate] (8.894 ms) : 0, 8894
Flare Poller [baseline] (3.873 ms) : 0, 3873
Flare Poller [candidate] (3.881 ms) : 0, 3881
section iast
crashtracking [baseline] (1.192 ms) : 0, 1192
crashtracking [candidate] (1.196 ms) : 0, 1196
BytebuddyAgent [baseline] (793.884 ms) : 0, 793884
BytebuddyAgent [candidate] (791.147 ms) : 0, 791147
GlobalTracer [baseline] (257.778 ms) : 0, 257778
GlobalTracer [candidate] (256.021 ms) : 0, 256021
IAST [baseline] (27.368 ms) : 0, 27368
IAST [candidate] (27.204 ms) : 0, 27204
AppSec [baseline] (35.663 ms) : 0, 35663
AppSec [candidate] (35.502 ms) : 0, 35502
Debugger [baseline] (66.815 ms) : 0, 66815
Debugger [candidate] (66.05 ms) : 0, 66050
Remote Config [baseline] (579.034 µs) : 0, 579
Remote Config [candidate] (545.999 µs) : 0, 546
Telemetry [baseline] (8.64 ms) : 0, 8640
Telemetry [candidate] (8.472 ms) : 0, 8472
Flare Poller [baseline] (3.505 ms) : 0, 3505
Flare Poller [candidate] (3.469 ms) : 0, 3469
section profiling
crashtracking [baseline] (1.209 ms) : 0, 1209
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (708.935 ms) : 0, 708935
BytebuddyAgent [candidate] (702.053 ms) : 0, 702053
GlobalTracer [baseline] (223.669 ms) : 0, 223669
GlobalTracer [candidate] (221.707 ms) : 0, 221707
AppSec [baseline] (32.938 ms) : 0, 32938
AppSec [candidate] (32.318 ms) : 0, 32318
Debugger [baseline] (69.041 ms) : 0, 69041
Debugger [candidate] (68.674 ms) : 0, 68674
Remote Config [baseline] (638.333 µs) : 0, 638
Remote Config [candidate] (651.386 µs) : 0, 651
Telemetry [baseline] (8.96 ms) : 0, 8960
Telemetry [candidate] (9.038 ms) : 0, 9038
Flare Poller [baseline] (3.762 ms) : 0, 3762
Flare Poller [candidate] (3.81 ms) : 0, 3810
ProfilingAgent [baseline] (98.451 ms) : 0, 98451
ProfilingAgent [candidate] (97.959 ms) : 0, 97959
Profiling [baseline] (99.031 ms) : 0, 99031
Profiling [candidate] (98.54 ms) : 0, 98540
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 4 performance regressions! Performance is the same for 13 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~bc8489613b, baseline=1.57.0-SNAPSHOT~823cec6aa6
dateFormat X
axisFormat %s
section baseline
no_agent (1.199 ms) : 1187, 1211
. : milestone, 1199,
iast (3.136 ms) : 3098, 3173
. : milestone, 3136,
iast_FULL (5.917 ms) : 5857, 5976
. : milestone, 5917,
iast_GLOBAL (3.636 ms) : 3581, 3691
. : milestone, 3636,
profiling (2.119 ms) : 2100, 2137
. : milestone, 2119,
tracing (1.824 ms) : 1809, 1839
. : milestone, 1824,
section candidate
no_agent (1.211 ms) : 1199, 1223
. : milestone, 1211,
iast (3.308 ms) : 3261, 3356
. : milestone, 3308,
iast_FULL (5.891 ms) : 5831, 5951
. : milestone, 5891,
iast_GLOBAL (3.631 ms) : 3574, 3688
. : milestone, 3631,
profiling (1.92 ms) : 1905, 1936
. : milestone, 1920,
tracing (1.766 ms) : 1752, 1780
. : milestone, 1766,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~bc8489613b, baseline=1.57.0-SNAPSHOT~823cec6aa6
dateFormat X
axisFormat %s
section baseline
no_agent (18.095 ms) : 17909, 18281
. : milestone, 18095,
appsec (18.658 ms) : 18472, 18845
. : milestone, 18658,
code_origins (17.563 ms) : 17387, 17738
. : milestone, 17563,
iast (17.706 ms) : 17526, 17886
. : milestone, 17706,
profiling (20.218 ms) : 20007, 20429
. : milestone, 20218,
tracing (17.545 ms) : 17371, 17719
. : milestone, 17545,
section candidate
no_agent (18.981 ms) : 18793, 19169
. : milestone, 18981,
appsec (18.481 ms) : 18294, 18668
. : milestone, 18481,
code_origins (18.777 ms) : 18586, 18969
. : milestone, 18777,
iast (17.675 ms) : 17502, 17848
. : milestone, 17675,
profiling (18.62 ms) : 18434, 18807
. : milestone, 18620,
tracing (18.579 ms) : 18390, 18767
. : milestone, 18579,
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~bc8489613b, baseline=1.57.0-SNAPSHOT~823cec6aa6
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1462, 1485
. : milestone, 1474,
appsec (3.694 ms) : 3477, 3911
. : milestone, 3694,
iast (2.204 ms) : 2140, 2268
. : milestone, 2204,
iast_GLOBAL (2.247 ms) : 2182, 2311
. : milestone, 2247,
profiling (2.064 ms) : 2012, 2116
. : milestone, 2064,
tracing (2.039 ms) : 1989, 2090
. : milestone, 2039,
section candidate
no_agent (1.473 ms) : 1461, 1484
. : milestone, 1473,
appsec (3.643 ms) : 3429, 3858
. : milestone, 3643,
iast (2.212 ms) : 2147, 2276
. : milestone, 2212,
iast_GLOBAL (2.25 ms) : 2185, 2315
. : milestone, 2250,
profiling (2.084 ms) : 2030, 2138
. : milestone, 2084,
tracing (2.052 ms) : 2001, 2103
. : milestone, 2052,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~bc8489613b, baseline=1.57.0-SNAPSHOT~823cec6aa6
dateFormat X
axisFormat %s
section baseline
no_agent (14.993 s) : 14993000, 14993000
. : milestone, 14993000,
appsec (14.554 s) : 14554000, 14554000
. : milestone, 14554000,
iast (18.126 s) : 18126000, 18126000
. : milestone, 18126000,
iast_GLOBAL (17.849 s) : 17849000, 17849000
. : milestone, 17849000,
profiling (14.425 s) : 14425000, 14425000
. : milestone, 14425000,
tracing (14.593 s) : 14593000, 14593000
. : milestone, 14593000,
section candidate
no_agent (15.014 s) : 15014000, 15014000
. : milestone, 15014000,
appsec (14.572 s) : 14572000, 14572000
. : milestone, 14572000,
iast (18.077 s) : 18077000, 18077000
. : milestone, 18077000,
iast_GLOBAL (18.06 s) : 18060000, 18060000
. : milestone, 18060000,
profiling (14.528 s) : 14528000, 14528000
. : milestone, 14528000,
tracing (14.975 s) : 14975000, 14975000
. : milestone, 14975000,
|
1c2f93a to
d2f2c41
Compare
d2f2c41 to
4945696
Compare
a433916 to
73c6a72
Compare
73c6a72 to
e5e2125
Compare
e5e2125 to
caecd3f
Compare
caecd3f to
8daa903
Compare
8daa903 to
337b3c6
Compare
337b3c6 to
61567f8
Compare
61567f8 to
8cefb2e
Compare
This causes all tests to use the same user preference folder, possibly increasing the chance of this issue happening.
Previous code, was generating a single gradle properties file per test.
ed7930d to
bc84896
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
comp: tooling
Build & Tooling
tag: no release notes
Changes to exclude from release notes
type: bug
Bug report and fix
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Does This Do
Prevents
that is observed after bumping the Gradle Daemon JDK to 21, see:
Motivation
CI stability
Additional Notes
CI builds intermittently (very often) fail with Java Preferences API file locking errors:
In particular it was spotted smoke jobs that ran the following tests
MetricProbesIntegrationTest(:dd-smoke-tests:debugger-integration-tests)SpringBootGrpcCompletableFutureTest(:dd-smoke-tests:springboot-grpc):dd-smoke-tests:gradle)Java's
FileSystemPreferencesstores user preferences in a shared directory:When
java.util.prefs.userRootis not set, all JVMs default to$HOME/.java/.userPrefs/. While there's no stack trace, looking at the code suggest the following :This code is triggered, the preferences system depends on the OS, on Linux the implementation is
FilePreferencesSystem. This messageCouldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.can only be created via this call stackThe sync method calls
FilePreferencesSystem.lockFile, which tries to acquire a file lock which actually a named lock file:$HOME/.java/.userPrefs/.user.lock.non-root-user. This method will try 5 times at most each time using an exponential backoff strategy. Looking at thew code and the error suggest it is not a permission issue which is confirmed by looking at the folder permissions on the runner:Also nothing fancy on the native part.
FilePreferencesSystemhas a static initializer that register inaddShutdownHooka timer task and a shutdown hook that callFilePreferencesSystem.syncWorld().Our project don't have to rely on preferences, but third party lib or build tool might use it. Also this error only happens for the user preferences only, which can be accessed via
java.util.prefs.Preferences.userRoot(), looking for that there's a couple of them,groovy,spring-beans,gradle(to workaround a Groovy Classloader leak) ...yet without hard evidence this code path is actually run, I can't incriminate them.Note, another avenue might be to disable user preferences for tests, for example by passing a custom preference factory.
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]