-
Notifications
You must be signed in to change notification settings - Fork 320
Fix thread-safety in AppSecRequestContext derivatives field #9923
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
|
🎯 Code Coverage 🔗 Commit SHA: 270a64c | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 54 metrics, 11 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.56.0-SNAPSHOT~270a64c93d, baseline=1.56.0-SNAPSHOT~7aef6ed5f2
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1045201
Total [baseline] (10.84 s) : 0, 10839558
Agent [candidate] (1.047 s) : 0, 1047480
Total [candidate] (10.742 s) : 0, 10741719
section appsec
Agent [baseline] (1.22 s) : 0, 1220276
Total [baseline] (10.914 s) : 0, 10913749
Agent [candidate] (1.223 s) : 0, 1222622
Total [candidate] (10.846 s) : 0, 10845718
section iast
Agent [baseline] (1.186 s) : 0, 1186393
Total [baseline] (11.153 s) : 0, 11152731
Agent [candidate] (1.201 s) : 0, 1200787
Total [candidate] (11.175 s) : 0, 11174564
section profiling
Agent [baseline] (1.202 s) : 0, 1202093
Total [baseline] (10.839 s) : 0, 10839399
Agent [candidate] (1.195 s) : 0, 1195316
Total [candidate] (10.957 s) : 0, 10956752
gantt
title petclinic - break down per module: candidate=1.56.0-SNAPSHOT~270a64c93d, baseline=1.56.0-SNAPSHOT~7aef6ed5f2
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.453 ms) : 0, 1453
crashtracking [candidate] (1.448 ms) : 0, 1448
BytebuddyAgent [baseline] (703.297 ms) : 0, 703297
BytebuddyAgent [candidate] (705.008 ms) : 0, 705008
GlobalTracer [baseline] (245.462 ms) : 0, 245462
GlobalTracer [candidate] (245.85 ms) : 0, 245850
AppSec [baseline] (32.324 ms) : 0, 32324
AppSec [candidate] (32.319 ms) : 0, 32319
Debugger [baseline] (6.345 ms) : 0, 6345
Debugger [candidate] (6.371 ms) : 0, 6371
Remote Config [baseline] (698.511 µs) : 0, 699
Remote Config [candidate] (706.876 µs) : 0, 707
Telemetry [baseline] (13.744 ms) : 0, 13744
Telemetry [candidate] (13.086 ms) : 0, 13086
Flare Poller [baseline] (7.199 ms) : 0, 7199
Flare Poller [candidate] (8.053 ms) : 0, 8053
section appsec
crashtracking [baseline] (1.446 ms) : 0, 1446
crashtracking [candidate] (1.448 ms) : 0, 1448
BytebuddyAgent [baseline] (728.074 ms) : 0, 728074
BytebuddyAgent [candidate] (729.578 ms) : 0, 729578
GlobalTracer [baseline] (236.87 ms) : 0, 236870
GlobalTracer [candidate] (237.791 ms) : 0, 237791
AppSec [baseline] (175.142 ms) : 0, 175142
AppSec [candidate] (174.725 ms) : 0, 174725
Debugger [baseline] (5.995 ms) : 0, 5995
Debugger [candidate] (6.033 ms) : 0, 6033
Remote Config [baseline] (647.423 µs) : 0, 647
Remote Config [candidate] (642.704 µs) : 0, 643
Telemetry [baseline] (8.538 ms) : 0, 8538
Telemetry [candidate] (8.504 ms) : 0, 8504
Flare Poller [baseline] (4.03 ms) : 0, 4030
Flare Poller [candidate] (4.04 ms) : 0, 4040
IAST [baseline] (24.771 ms) : 0, 24771
IAST [candidate] (24.987 ms) : 0, 24987
section iast
crashtracking [baseline] (1.467 ms) : 0, 1467
crashtracking [candidate] (1.483 ms) : 0, 1483
BytebuddyAgent [baseline] (832.995 ms) : 0, 832995
BytebuddyAgent [candidate] (844.213 ms) : 0, 844213
GlobalTracer [baseline] (236.466 ms) : 0, 236466
GlobalTracer [candidate] (237.977 ms) : 0, 237977
AppSec [baseline] (26.987 ms) : 0, 26987
AppSec [candidate] (28.4 ms) : 0, 28400
Debugger [baseline] (6.012 ms) : 0, 6012
Debugger [candidate] (6.123 ms) : 0, 6123
Remote Config [baseline] (601.506 µs) : 0, 602
Remote Config [candidate] (606.122 µs) : 0, 606
Telemetry [baseline] (8.331 ms) : 0, 8331
Telemetry [candidate] (8.738 ms) : 0, 8738
Flare Poller [baseline] (4.107 ms) : 0, 4107
Flare Poller [candidate] (4.154 ms) : 0, 4154
IAST [baseline] (34.533 ms) : 0, 34533
IAST [candidate] (34.032 ms) : 0, 34032
section profiling
ProfilingAgent [baseline] (111.473 ms) : 0, 111473
ProfilingAgent [candidate] (111.004 ms) : 0, 111004
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.456 ms) : 0, 1456
BytebuddyAgent [baseline] (735.131 ms) : 0, 735131
BytebuddyAgent [candidate] (730.111 ms) : 0, 730111
GlobalTracer [baseline] (223.853 ms) : 0, 223853
GlobalTracer [candidate] (222.197 ms) : 0, 222197
AppSec [baseline] (32.436 ms) : 0, 32436
AppSec [candidate] (32.497 ms) : 0, 32497
Debugger [baseline] (9.85 ms) : 0, 9850
Debugger [candidate] (7.61 ms) : 0, 7610
Remote Config [baseline] (682.607 µs) : 0, 683
Remote Config [candidate] (1.403 ms) : 0, 1403
Telemetry [baseline] (12.898 ms) : 0, 12898
Telemetry [candidate] (14.733 ms) : 0, 14733
Flare Poller [baseline] (4.245 ms) : 0, 4245
Flare Poller [candidate] (4.169 ms) : 0, 4169
Profiling [baseline] (112.127 ms) : 0, 112127
Profiling [candidate] (111.701 ms) : 0, 111701
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.56.0-SNAPSHOT~270a64c93d, baseline=1.56.0-SNAPSHOT~7aef6ed5f2
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1056606
Total [baseline] (8.655 s) : 0, 8654992
Agent [candidate] (1.048 s) : 0, 1048409
Total [candidate] (8.617 s) : 0, 8616925
section iast
Agent [baseline] (1.178 s) : 0, 1177730
Total [baseline] (9.243 s) : 0, 9243443
Agent [candidate] (1.184 s) : 0, 1183508
Total [candidate] (9.256 s) : 0, 9256237
gantt
title insecure-bank - break down per module: candidate=1.56.0-SNAPSHOT~270a64c93d, baseline=1.56.0-SNAPSHOT~7aef6ed5f2
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.475 ms) : 0, 1475
crashtracking [candidate] (1.455 ms) : 0, 1455
BytebuddyAgent [baseline] (711.207 ms) : 0, 711207
BytebuddyAgent [candidate] (705.526 ms) : 0, 705526
GlobalTracer [baseline] (248.015 ms) : 0, 248015
GlobalTracer [candidate] (246.124 ms) : 0, 246124
AppSec [baseline] (32.755 ms) : 0, 32755
AppSec [candidate] (32.396 ms) : 0, 32396
Debugger [baseline] (6.527 ms) : 0, 6527
Debugger [candidate] (6.424 ms) : 0, 6424
Remote Config [baseline] (714.635 µs) : 0, 715
Remote Config [candidate] (708.535 µs) : 0, 709
Telemetry [baseline] (13.817 ms) : 0, 13817
Telemetry [candidate] (12.166 ms) : 0, 12166
Flare Poller [baseline] (7.224 ms) : 0, 7224
Flare Poller [candidate] (8.935 ms) : 0, 8935
section iast
crashtracking [baseline] (1.463 ms) : 0, 1463
crashtracking [candidate] (1.467 ms) : 0, 1467
BytebuddyAgent [baseline] (827.015 ms) : 0, 827015
BytebuddyAgent [candidate] (832.288 ms) : 0, 832288
GlobalTracer [baseline] (234.173 ms) : 0, 234173
GlobalTracer [candidate] (234.776 ms) : 0, 234776
AppSec [baseline] (28.624 ms) : 0, 28624
AppSec [candidate] (28.624 ms) : 0, 28624
Debugger [baseline] (5.974 ms) : 0, 5974
Debugger [candidate] (6.002 ms) : 0, 6002
Remote Config [baseline] (598.755 µs) : 0, 599
Remote Config [candidate] (593.791 µs) : 0, 594
Telemetry [baseline] (8.339 ms) : 0, 8339
Telemetry [candidate] (8.435 ms) : 0, 8435
Flare Poller [baseline] (4.135 ms) : 0, 4135
Flare Poller [candidate] (4.118 ms) : 0, 4118
IAST [baseline] (32.691 ms) : 0, 32691
IAST [candidate] (32.259 ms) : 0, 32259
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 1 performance regressions! Performance is the same for 10 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~270a64c93d, baseline=1.56.0-SNAPSHOT~7aef6ed5f2
dateFormat X
axisFormat %s
section baseline
no_agent (1.177 ms) : 1166, 1189
. : milestone, 1177,
iast (3.188 ms) : 3143, 3232
. : milestone, 3188,
iast_FULL (5.681 ms) : 5625, 5738
. : milestone, 5681,
iast_GLOBAL (3.598 ms) : 3542, 3653
. : milestone, 3598,
profiling (2.027 ms) : 2009, 2045
. : milestone, 2027,
tracing (1.811 ms) : 1796, 1826
. : milestone, 1811,
section candidate
no_agent (1.179 ms) : 1168, 1191
. : milestone, 1179,
iast (3.166 ms) : 3129, 3204
. : milestone, 3166,
iast_FULL (5.662 ms) : 5606, 5718
. : milestone, 5662,
iast_GLOBAL (3.567 ms) : 3507, 3628
. : milestone, 3567,
profiling (1.91 ms) : 1895, 1926
. : milestone, 1910,
tracing (1.769 ms) : 1754, 1784
. : milestone, 1769,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~270a64c93d, baseline=1.56.0-SNAPSHOT~7aef6ed5f2
dateFormat X
axisFormat %s
section baseline
no_agent (17.365 ms) : 17191, 17539
. : milestone, 17365,
appsec (19.494 ms) : 19293, 19696
. : milestone, 19494,
code_origins (17.723 ms) : 17546, 17900
. : milestone, 17723,
iast (18.04 ms) : 17859, 18220
. : milestone, 18040,
profiling (18.936 ms) : 18744, 19128
. : milestone, 18936,
tracing (17.449 ms) : 17273, 17625
. : milestone, 17449,
section candidate
no_agent (19.026 ms) : 18829, 19224
. : milestone, 19026,
appsec (19.325 ms) : 19122, 19528
. : milestone, 19325,
code_origins (17.907 ms) : 17730, 18084
. : milestone, 17907,
iast (18.516 ms) : 18330, 18703
. : milestone, 18516,
profiling (19.308 ms) : 19116, 19500
. : milestone, 19308,
tracing (17.592 ms) : 17415, 17769
. : milestone, 17592,
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.56.0-SNAPSHOT~270a64c93d, baseline=1.56.0-SNAPSHOT~7aef6ed5f2
dateFormat X
axisFormat %s
section baseline
no_agent (1.469 ms) : 1458, 1481
. : milestone, 1469,
appsec (3.638 ms) : 3424, 3852
. : milestone, 3638,
iast (2.207 ms) : 2143, 2271
. : milestone, 2207,
iast_GLOBAL (2.248 ms) : 2183, 2312
. : milestone, 2248,
profiling (2.048 ms) : 1997, 2100
. : milestone, 2048,
tracing (2.029 ms) : 1979, 2079
. : milestone, 2029,
section candidate
no_agent (1.47 ms) : 1459, 1482
. : milestone, 1470,
appsec (3.685 ms) : 3469, 3900
. : milestone, 3685,
iast (2.214 ms) : 2150, 2278
. : milestone, 2214,
iast_GLOBAL (2.239 ms) : 2175, 2302
. : milestone, 2239,
profiling (2.048 ms) : 1997, 2100
. : milestone, 2048,
tracing (2.03 ms) : 1980, 2079
. : milestone, 2030,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~270a64c93d, baseline=1.56.0-SNAPSHOT~7aef6ed5f2
dateFormat X
axisFormat %s
section baseline
no_agent (15.264 s) : 15264000, 15264000
. : milestone, 15264000,
appsec (14.835 s) : 14835000, 14835000
. : milestone, 14835000,
iast (18.438 s) : 18438000, 18438000
. : milestone, 18438000,
iast_GLOBAL (18.076 s) : 18076000, 18076000
. : milestone, 18076000,
profiling (15.256 s) : 15256000, 15256000
. : milestone, 15256000,
tracing (14.63 s) : 14630000, 14630000
. : milestone, 14630000,
section candidate
no_agent (15.694 s) : 15694000, 15694000
. : milestone, 15694000,
appsec (14.8 s) : 14800000, 14800000
. : milestone, 14800000,
iast (18.248 s) : 18248000, 18248000
. : milestone, 18248000,
iast_GLOBAL (18.171 s) : 18171000, 18171000
. : milestone, 18171000,
profiling (15.183 s) : 15183000, 15183000
. : milestone, 15183000,
tracing (14.712 s) : 14712000, 14712000
. : milestone, 14712000,
|
What Does This Do
The
derivativesfield inAppSecRequestContextused a volatile Map that didn't guarantee atomicity for read-modify-write operations. This could cause race conditions when multiple threads tried to report derivatives simultaneously, for instance:or
Migrates the derivatives field from:
private volatile Map<String, Object>derivatives; to:private final AtomicReference<Map<String, Object>> derivatives = new AtomicReference<>();Motivation
Fix error tracking reports:
https://app.datadoghq.com/error-tracking?query=&refresh_mode=sliding&source=all&sp=%5B%7B%22p%22%3A%7B%22issueId%22%3A%22c9383710-b433-11f0-aead-da7ad0900002%22%7D%2C%22i%22%3A%22error-tracking-issue%22%7D%5D&from_ts=1761653816420&to_ts=1761740216420&live=true
https://app.datadoghq.com/error-tracking?query=&refresh_mode=sliding&source=all&sp=%5B%7B%22p%22%3A%7B%22issueId%22%3A%222411fa78-b69a-11f0-ae64-da7ad0900002%22%7D%2C%22i%22%3A%22error-tracking-issue%22%7D%5D&from_ts=1761904242753&to_ts=1761990642753&live=true
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: APPSEC-59850 and APPSEC-59884