Skip to content

Take defensive copy of parent scope stack when closing nested coroutines #8749

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
merged 2 commits into from
Apr 29, 2025

Conversation

mcculls
Copy link
Contributor

@mcculls mcculls commented Apr 29, 2025

What Does This Do

This PR applies some short-term defensive fixes:

  • Remove newScopeState().fetchFromActive() code path in favour of oldScopeState() which does both
  • Remove the cached coroutine context item when we first start closing the coroutine, not at the end
  • Take defensive copy of parent scope stack when closing nested child coroutines

Motivation

The parent coroutine scope stack is only used for cleanup purposes in certain situations and using a defensive copy avoids potential concurrent modification issues when different child coroutines are closed at the same time across multiple threads.

Additional Notes

This code is being refactored as part of further context improvements, so these defensive fixes are only needed in the short-term.

Contributor Checklist

Jira ticket: APMS-15615

@mcculls mcculls added type: bug inst: kotlin Kotlin instrumentation labels Apr 29, 2025
@mcculls mcculls marked this pull request as ready for review April 29, 2025 11:52
@mcculls mcculls requested review from a team as code owners April 29, 2025 11:52
@mcculls mcculls requested a review from amarziali April 29, 2025 11:52
@mcculls mcculls force-pushed the mcculls/kotlin-coroutines-defensive-copy branch from c83ce0e to 3599902 Compare April 29, 2025 12:23
if (contextItem != null) {
ScopeState currentThreadScopeState = null;
if (parent != null) {
final ScopeStateCoroutineContextItem parentItem = contextItemPerCoroutine.get(parent);
if (parentItem != null) {
currentThreadScopeState = parentItem.getScopeState();
// take defensive copy of parent scope stack
currentThreadScopeState = parentItem.copyScopeState();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copying looks pretty costly however it should not be an issue given that it's called only when the coroutine reach its termination state

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e224cd2 should reduce this to only copying when it's essential

Note this whole area of code will soon get refactored/replaced - so this is only needed in the short-term

@pr-commenter
Copy link

pr-commenter bot commented Apr 29, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/kotlin-coroutines-defensive-copy
git_commit_date 1745935074 1745942680
git_commit_sha 74633af bc7c702
release_version 1.49.0-SNAPSHOT~74633afbc6 1.49.0-SNAPSHOT~bc7c702e0c
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1745945616 1745945616
ci_job_id 917271549 917271549
ci_pipeline_id 63635532 63635532
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-stvtq5db-project-304-concurrent-0-am47tslp 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-stvtq5db-project-304-concurrent-0-am47tslp 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 63 metrics, 8 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.49.0-SNAPSHOT~bc7c702e0c, baseline=1.49.0-SNAPSHOT~74633afbc6

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.007 s) : 0, 1006997
Total [baseline] (10.566 s) : 0, 10566299
Agent [candidate] (1.015 s) : 0, 1014838
Total [candidate] (10.596 s) : 0, 10595559
section appsec
Agent [baseline] (1.152 s) : 0, 1152100
Total [baseline] (10.66 s) : 0, 10660019
Agent [candidate] (1.15 s) : 0, 1149939
Total [candidate] (10.68 s) : 0, 10680282
section iast
Agent [baseline] (1.137 s) : 0, 1137003
Total [baseline] (10.775 s) : 0, 10774724
Agent [candidate] (1.136 s) : 0, 1135852
Total [candidate] (10.821 s) : 0, 10821403
section profiling
Agent [baseline] (1.256 s) : 0, 1255733
Total [baseline] (10.797 s) : 0, 10797261
Agent [candidate] (1.263 s) : 0, 1262565
Total [candidate] (10.778 s) : 0, 10777846
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.007 s -
Agent appsec 1.152 s 145.103 ms (14.4%)
Agent iast 1.137 s 130.007 ms (12.9%)
Agent profiling 1.256 s 248.736 ms (24.7%)
Total tracing 10.566 s -
Total appsec 10.66 s 93.721 ms (0.9%)
Total iast 10.775 s 208.425 ms (2.0%)
Total profiling 10.797 s 230.962 ms (2.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.015 s -
Agent appsec 1.15 s 135.1 ms (13.3%)
Agent iast 1.136 s 121.014 ms (11.9%)
Agent profiling 1.263 s 247.727 ms (24.4%)
Total tracing 10.596 s -
Total appsec 10.68 s 84.723 ms (0.8%)
Total iast 10.821 s 225.844 ms (2.1%)
Total profiling 10.778 s 182.287 ms (1.7%)
gantt
    title petclinic - break down per module: candidate=1.49.0-SNAPSHOT~bc7c702e0c, baseline=1.49.0-SNAPSHOT~74633afbc6

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (670.908 ms) : 0, 670908
BytebuddyAgent [candidate] (676.581 ms) : 0, 676581
GlobalTracer [baseline] (240.446 ms) : 0, 240446
GlobalTracer [candidate] (241.683 ms) : 0, 241683
AppSec [baseline] (54.688 ms) : 0, 54688
AppSec [candidate] (55.086 ms) : 0, 55086
Debugger [baseline] (6.152 ms) : 0, 6152
Debugger [candidate] (6.914 ms) : 0, 6914
Remote Config [baseline] (697.01 µs) : 0, 697
Remote Config [candidate] (704.921 µs) : 0, 705
Telemetry [baseline] (10.675 ms) : 0, 10675
Telemetry [candidate] (9.978 ms) : 0, 9978
section appsec
BytebuddyAgent [baseline] (690.838 ms) : 0, 690838
BytebuddyAgent [candidate] (689.268 ms) : 0, 689268
GlobalTracer [baseline] (237.018 ms) : 0, 237018
GlobalTracer [candidate] (236.778 ms) : 0, 236778
AppSec [baseline] (175.64 ms) : 0, 175640
AppSec [candidate] (174.493 ms) : 0, 174493
Debugger [baseline] (5.837 ms) : 0, 5837
Debugger [candidate] (5.849 ms) : 0, 5849
Remote Config [baseline] (635.734 µs) : 0, 636
Remote Config [candidate] (631.143 µs) : 0, 631
Telemetry [baseline] (7.751 ms) : 0, 7751
Telemetry [candidate] (8.558 ms) : 0, 8558
IAST [baseline] (21.743 ms) : 0, 21743
IAST [candidate] (21.793 ms) : 0, 21793
section iast
BytebuddyAgent [baseline] (789.916 ms) : 0, 789916
BytebuddyAgent [candidate] (788.976 ms) : 0, 788976
GlobalTracer [baseline] (230.086 ms) : 0, 230086
GlobalTracer [candidate] (229.777 ms) : 0, 229777
AppSec [baseline] (56.627 ms) : 0, 56627
AppSec [candidate] (56.553 ms) : 0, 56553
Debugger [baseline] (5.859 ms) : 0, 5859
Debugger [candidate] (5.906 ms) : 0, 5906
Remote Config [baseline] (598.203 µs) : 0, 598
Remote Config [candidate] (577.243 µs) : 0, 577
Telemetry [baseline] (7.837 ms) : 0, 7837
Telemetry [candidate] (7.903 ms) : 0, 7903
IAST [baseline] (22.673 ms) : 0, 22673
IAST [candidate] (22.8 ms) : 0, 22800
section profiling
BytebuddyAgent [baseline] (662.919 ms) : 0, 662919
BytebuddyAgent [candidate] (667.888 ms) : 0, 667888
GlobalTracer [baseline] (376.293 ms) : 0, 376293
GlobalTracer [candidate] (378.538 ms) : 0, 378538
AppSec [baseline] (54.287 ms) : 0, 54287
AppSec [candidate] (53.652 ms) : 0, 53652
Debugger [baseline] (6.129 ms) : 0, 6129
Debugger [candidate] (6.178 ms) : 0, 6178
Remote Config [baseline] (664.865 µs) : 0, 665
Remote Config [candidate] (651.481 µs) : 0, 651
Telemetry [baseline] (8.217 ms) : 0, 8217
Telemetry [candidate] (8.268 ms) : 0, 8268
ProfilingAgent [baseline] (96.996 ms) : 0, 96996
ProfilingAgent [candidate] (96.856 ms) : 0, 96856
Profiling [baseline] (97.019 ms) : 0, 97019
Profiling [candidate] (96.88 ms) : 0, 96880
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.49.0-SNAPSHOT~bc7c702e0c, baseline=1.49.0-SNAPSHOT~74633afbc6

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.009 s) : 0, 1009110
Total [baseline] (8.629 s) : 0, 8629479
Agent [candidate] (1.011 s) : 0, 1010592
Total [candidate] (8.649 s) : 0, 8649051
section iast
Agent [baseline] (1.135 s) : 0, 1135144
Total [baseline] (9.206 s) : 0, 9206477
Agent [candidate] (1.142 s) : 0, 1142198
Total [candidate] (9.221 s) : 0, 9220826
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.135 s) : 0, 1134793
Total [baseline] (9.174 s) : 0, 9173787
Agent [candidate] (1.139 s) : 0, 1139428
Total [candidate] (9.222 s) : 0, 9221507
section iast_TELEMETRY_OFF
Agent [baseline] (1.146 s) : 0, 1146036
Total [baseline] (9.213 s) : 0, 9212523
Agent [candidate] (1.141 s) : 0, 1141081
Total [candidate] (9.183 s) : 0, 9182672
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.009 s -
Agent iast 1.135 s 126.034 ms (12.5%)
Agent iast_HARDCODED_SECRET_DISABLED 1.135 s 125.683 ms (12.5%)
Agent iast_TELEMETRY_OFF 1.146 s 136.926 ms (13.6%)
Total tracing 8.629 s -
Total iast 9.206 s 576.998 ms (6.7%)
Total iast_HARDCODED_SECRET_DISABLED 9.174 s 544.307 ms (6.3%)
Total iast_TELEMETRY_OFF 9.213 s 583.044 ms (6.8%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.011 s -
Agent iast 1.142 s 131.606 ms (13.0%)
Agent iast_HARDCODED_SECRET_DISABLED 1.139 s 128.836 ms (12.7%)
Agent iast_TELEMETRY_OFF 1.141 s 130.489 ms (12.9%)
Total tracing 8.649 s -
Total iast 9.221 s 571.775 ms (6.6%)
Total iast_HARDCODED_SECRET_DISABLED 9.222 s 572.456 ms (6.6%)
Total iast_TELEMETRY_OFF 9.183 s 533.621 ms (6.2%)
gantt
    title insecure-bank - break down per module: candidate=1.49.0-SNAPSHOT~bc7c702e0c, baseline=1.49.0-SNAPSHOT~74633afbc6

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (674.509 ms) : 0, 674509
BytebuddyAgent [candidate] (672.586 ms) : 0, 672586
GlobalTracer [baseline] (240.458 ms) : 0, 240458
GlobalTracer [candidate] (241.196 ms) : 0, 241196
AppSec [baseline] (54.577 ms) : 0, 54577
AppSec [candidate] (54.849 ms) : 0, 54849
Debugger [baseline] (6.933 ms) : 0, 6933
Debugger [candidate] (7.693 ms) : 0, 7693
Remote Config [baseline] (700.5 µs) : 0, 701
Remote Config [candidate] (698.515 µs) : 0, 699
Telemetry [baseline] (8.419 ms) : 0, 8419
Telemetry [candidate] (9.957 ms) : 0, 9957
section iast
BytebuddyAgent [baseline] (788.667 ms) : 0, 788667
BytebuddyAgent [candidate] (793.726 ms) : 0, 793726
GlobalTracer [baseline] (229.502 ms) : 0, 229502
GlobalTracer [candidate] (231.144 ms) : 0, 231144
AppSec [baseline] (55.939 ms) : 0, 55939
AppSec [candidate] (56.549 ms) : 0, 56549
Debugger [baseline] (5.817 ms) : 0, 5817
Debugger [candidate] (5.909 ms) : 0, 5909
Remote Config [baseline] (581.005 µs) : 0, 581
Remote Config [candidate] (600.684 µs) : 0, 601
Telemetry [baseline] (7.871 ms) : 0, 7871
Telemetry [candidate] (7.973 ms) : 0, 7973
IAST [baseline] (23.366 ms) : 0, 23366
IAST [candidate] (22.885 ms) : 0, 22885
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (788.715 ms) : 0, 788715
BytebuddyAgent [candidate] (790.016 ms) : 0, 790016
GlobalTracer [baseline] (229.331 ms) : 0, 229331
GlobalTracer [candidate] (231.524 ms) : 0, 231524
AppSec [baseline] (56.24 ms) : 0, 56240
AppSec [candidate] (56.77 ms) : 0, 56770
Debugger [baseline] (5.889 ms) : 0, 5889
Debugger [candidate] (6.035 ms) : 0, 6035
Remote Config [baseline] (580.587 µs) : 0, 581
Remote Config [candidate] (618.244 µs) : 0, 618
Telemetry [baseline] (7.894 ms) : 0, 7894
Telemetry [candidate] (8.01 ms) : 0, 8010
IAST [baseline] (22.689 ms) : 0, 22689
IAST [candidate] (23.0 ms) : 0, 23000
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (797.924 ms) : 0, 797924
BytebuddyAgent [candidate] (792.544 ms) : 0, 792544
GlobalTracer [baseline] (231.405 ms) : 0, 231405
GlobalTracer [candidate] (231.228 ms) : 0, 231228
AppSec [baseline] (56.346 ms) : 0, 56346
AppSec [candidate] (56.782 ms) : 0, 56782
Debugger [baseline] (5.942 ms) : 0, 5942
Debugger [candidate] (5.983 ms) : 0, 5983
Remote Config [baseline] (597.71 µs) : 0, 598
Remote Config [candidate] (616.846 µs) : 0, 617
Telemetry [baseline] (7.777 ms) : 0, 7777
Telemetry [candidate] (7.813 ms) : 0, 7813
IAST [baseline] (22.41 ms) : 0, 22410
IAST [candidate] (22.473 ms) : 0, 22473
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-04-29T16:26:27 2025-04-29T16:34:11
git_branch master mcculls/kotlin-coroutines-defensive-copy
git_commit_date 1745935074 1745942680
git_commit_sha 74633af bc7c702
release_version 1.49.0-SNAPSHOT~74633afbc6 1.49.0-SNAPSHOT~bc7c702e0c
start_time 2025-04-29T16:26:13 2025-04-29T16:33:56
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1745944850 1745944850
ci_job_id 917271550 917271550
ci_pipeline_id 63635532 63635532
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-df2tp9k5-project-304-concurrent-0-38m9jsna 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-df2tp9k5-project-304-concurrent-0-38m9jsna 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 18 unstable metrics.

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~bc7c702e0c, baseline=1.49.0-SNAPSHOT~74633afbc6
    dateFormat X
    axisFormat %s
section baseline
no_agent (378.343 µs) : 358, 398
.   : milestone, 378,
iast (525.33 µs) : 502, 549
.   : milestone, 525,
iast_FULL (735.22 µs) : 712, 759
.   : milestone, 735,
iast_GLOBAL (563.855 µs) : 540, 588
.   : milestone, 564,
iast_HARDCODED_SECRET_DISABLED (515.332 µs) : 492, 538
.   : milestone, 515,
iast_INACTIVE (471.425 µs) : 449, 494
.   : milestone, 471,
iast_TELEMETRY_OFF (505.393 µs) : 482, 528
.   : milestone, 505,
tracing (457.678 µs) : 436, 480
.   : milestone, 458,
section candidate
no_agent (381.268 µs) : 360, 402
.   : milestone, 381,
iast (517.98 µs) : 494, 542
.   : milestone, 518,
iast_FULL (733.782 µs) : 711, 757
.   : milestone, 734,
iast_GLOBAL (567.47 µs) : 543, 592
.   : milestone, 567,
iast_HARDCODED_SECRET_DISABLED (524.247 µs) : 501, 547
.   : milestone, 524,
iast_INACTIVE (462.241 µs) : 440, 484
.   : milestone, 462,
iast_TELEMETRY_OFF (496.862 µs) : 474, 520
.   : milestone, 497,
tracing (457.7 µs) : 435, 480
.   : milestone, 458,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 378.343 µs [358.453 µs, 398.233 µs] -
iast 525.33 µs [502.077 µs, 548.582 µs] 146.986 µs (38.9%)
iast_FULL 735.22 µs [711.849 µs, 758.59 µs] 356.877 µs (94.3%)
iast_GLOBAL 563.855 µs [539.9 µs, 587.81 µs] 185.512 µs (49.0%)
iast_HARDCODED_SECRET_DISABLED 515.332 µs [492.204 µs, 538.46 µs] 136.989 µs (36.2%)
iast_INACTIVE 471.425 µs [448.533 µs, 494.317 µs] 93.082 µs (24.6%)
iast_TELEMETRY_OFF 505.393 µs [482.414 µs, 528.373 µs] 127.05 µs (33.6%)
tracing 457.678 µs [435.666 µs, 479.689 µs] 79.335 µs (21.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 381.268 µs [360.174 µs, 402.361 µs] -
iast 517.98 µs [494.245 µs, 541.715 µs] 136.712 µs (35.9%)
iast_FULL 733.782 µs [710.545 µs, 757.02 µs] 352.515 µs (92.5%)
iast_GLOBAL 567.47 µs [543.089 µs, 591.85 µs] 186.202 µs (48.8%)
iast_HARDCODED_SECRET_DISABLED 524.247 µs [501.482 µs, 547.012 µs] 142.98 µs (37.5%)
iast_INACTIVE 462.241 µs [440.059 µs, 484.423 µs] 80.973 µs (21.2%)
iast_TELEMETRY_OFF 496.862 µs [473.799 µs, 519.925 µs] 115.594 µs (30.3%)
tracing 457.7 µs [435.163 µs, 480.237 µs] 76.433 µs (20.0%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~bc7c702e0c, baseline=1.49.0-SNAPSHOT~74633afbc6
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.344 ms) : 1325, 1364
.   : milestone, 1344,
appsec (1.738 ms) : 1714, 1762
.   : milestone, 1738,
appsec_no_iast (1.716 ms) : 1691, 1740
.   : milestone, 1716,
code_origins (1.688 ms) : 1661, 1714
.   : milestone, 1688,
iast (1.509 ms) : 1484, 1533
.   : milestone, 1509,
profiling (1.56 ms) : 1536, 1585
.   : milestone, 1560,
tracing (1.484 ms) : 1460, 1509
.   : milestone, 1484,
section candidate
no_agent (1.358 ms) : 1338, 1378
.   : milestone, 1358,
appsec (1.731 ms) : 1708, 1753
.   : milestone, 1731,
appsec_no_iast (1.729 ms) : 1705, 1753
.   : milestone, 1729,
code_origins (1.689 ms) : 1662, 1716
.   : milestone, 1689,
iast (1.515 ms) : 1491, 1539
.   : milestone, 1515,
profiling (1.555 ms) : 1530, 1579
.   : milestone, 1555,
tracing (1.5 ms) : 1476, 1525
.   : milestone, 1500,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.344 ms [1.325 ms, 1.364 ms] -
appsec 1.738 ms [1.714 ms, 1.762 ms] 393.834 µs (29.3%)
appsec_no_iast 1.716 ms [1.691 ms, 1.74 ms] 371.481 µs (27.6%)
code_origins 1.688 ms [1.661 ms, 1.714 ms] 343.402 µs (25.5%)
iast 1.509 ms [1.484 ms, 1.533 ms] 164.403 µs (12.2%)
profiling 1.56 ms [1.536 ms, 1.585 ms] 216.375 µs (16.1%)
tracing 1.484 ms [1.46 ms, 1.509 ms] 140.279 µs (10.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.358 ms [1.338 ms, 1.378 ms] -
appsec 1.731 ms [1.708 ms, 1.753 ms] 372.658 µs (27.4%)
appsec_no_iast 1.729 ms [1.705 ms, 1.753 ms] 370.665 µs (27.3%)
code_origins 1.689 ms [1.662 ms, 1.716 ms] 331.106 µs (24.4%)
iast 1.515 ms [1.491 ms, 1.539 ms] 157.185 µs (11.6%)
profiling 1.555 ms [1.53 ms, 1.579 ms] 197.045 µs (14.5%)
tracing 1.5 ms [1.476 ms, 1.525 ms] 142.298 µs (10.5%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/kotlin-coroutines-defensive-copy
git_commit_date 1745935074 1745942680
git_commit_sha 74633af bc7c702
release_version 1.49.0-SNAPSHOT~74633afbc6 1.49.0-SNAPSHOT~bc7c702e0c
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1745945200 1745945200
ci_job_id 917271551 917271551
ci_pipeline_id 63635532 63635532
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-yu7uw3kp-project-304-concurrent-0-fqrhr6sm 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-yu7uw3kp-project-304-concurrent-0-fqrhr6sm 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~bc7c702e0c, baseline=1.49.0-SNAPSHOT~74633afbc6
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.723 s) : 14723000, 14723000
.   : milestone, 14723000,
appsec (15.197 s) : 15197000, 15197000
.   : milestone, 15197000,
iast (18.836 s) : 18836000, 18836000
.   : milestone, 18836000,
iast_GLOBAL (18.016 s) : 18016000, 18016000
.   : milestone, 18016000,
profiling (14.841 s) : 14841000, 14841000
.   : milestone, 14841000,
tracing (14.944 s) : 14944000, 14944000
.   : milestone, 14944000,
section candidate
no_agent (14.963 s) : 14963000, 14963000
.   : milestone, 14963000,
appsec (14.845 s) : 14845000, 14845000
.   : milestone, 14845000,
iast (18.396 s) : 18396000, 18396000
.   : milestone, 18396000,
iast_GLOBAL (18.258 s) : 18258000, 18258000
.   : milestone, 18258000,
profiling (15.716 s) : 15716000, 15716000
.   : milestone, 15716000,
tracing (14.802 s) : 14802000, 14802000
.   : milestone, 14802000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.723 s [14.723 s, 14.723 s] -
appsec 15.197 s [15.197 s, 15.197 s] 474.0 ms (3.2%)
iast 18.836 s [18.836 s, 18.836 s] 4.113 s (27.9%)
iast_GLOBAL 18.016 s [18.016 s, 18.016 s] 3.293 s (22.4%)
profiling 14.841 s [14.841 s, 14.841 s] 118.0 ms (0.8%)
tracing 14.944 s [14.944 s, 14.944 s] 221.0 ms (1.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.963 s [14.963 s, 14.963 s] -
appsec 14.845 s [14.845 s, 14.845 s] -118.0 ms (-0.8%)
iast 18.396 s [18.396 s, 18.396 s] 3.433 s (22.9%)
iast_GLOBAL 18.258 s [18.258 s, 18.258 s] 3.295 s (22.0%)
profiling 15.716 s [15.716 s, 15.716 s] 753.0 ms (5.0%)
tracing 14.802 s [14.802 s, 14.802 s] -161.0 ms (-1.1%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~bc7c702e0c, baseline=1.49.0-SNAPSHOT~74633afbc6
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.479 ms) : 1468, 1491
.   : milestone, 1479,
appsec (2.379 ms) : 2332, 2425
.   : milestone, 2379,
iast (2.163 ms) : 2104, 2222
.   : milestone, 2163,
iast_GLOBAL (2.201 ms) : 2142, 2260
.   : milestone, 2201,
profiling (2.023 ms) : 1976, 2070
.   : milestone, 2023,
tracing (1.982 ms) : 1937, 2027
.   : milestone, 1982,
section candidate
no_agent (1.477 ms) : 1465, 1488
.   : milestone, 1477,
appsec (2.381 ms) : 2334, 2428
.   : milestone, 2381,
iast (2.156 ms) : 2097, 2215
.   : milestone, 2156,
iast_GLOBAL (2.198 ms) : 2139, 2258
.   : milestone, 2198,
profiling (2.03 ms) : 1981, 2078
.   : milestone, 2030,
tracing (2.008 ms) : 1962, 2054
.   : milestone, 2008,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.479 ms [1.468 ms, 1.491 ms] -
appsec 2.379 ms [2.332 ms, 2.425 ms] 899.279 µs (60.8%)
iast 2.163 ms [2.104 ms, 2.222 ms] 683.499 µs (46.2%)
iast_GLOBAL 2.201 ms [2.142 ms, 2.26 ms] 721.713 µs (48.8%)
profiling 2.023 ms [1.976 ms, 2.07 ms] 543.187 µs (36.7%)
tracing 1.982 ms [1.937 ms, 2.027 ms] 502.251 µs (33.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.477 ms [1.465 ms, 1.488 ms] -
appsec 2.381 ms [2.334 ms, 2.428 ms] 904.295 µs (61.2%)
iast 2.156 ms [2.097 ms, 2.215 ms] 679.167 µs (46.0%)
iast_GLOBAL 2.198 ms [2.139 ms, 2.258 ms] 721.768 µs (48.9%)
profiling 2.03 ms [1.981 ms, 2.078 ms] 553.154 µs (37.5%)
tracing 2.008 ms [1.962 ms, 2.054 ms] 531.333 µs (36.0%)

@mcculls mcculls force-pushed the mcculls/kotlin-coroutines-defensive-copy branch from 65db493 to e224cd2 Compare April 29, 2025 12:41
@mcculls mcculls force-pushed the mcculls/kotlin-coroutines-defensive-copy branch from e224cd2 to bc7c702 Compare April 29, 2025 16:04
@mcculls mcculls merged commit e8a2156 into master Apr 29, 2025
457 checks passed
@mcculls mcculls deleted the mcculls/kotlin-coroutines-defensive-copy branch April 29, 2025 20:32
@github-actions github-actions bot added this to the 1.49.0 milestone Apr 29, 2025
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request May 7, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
|
[com.google.cloud:google-cloud-logging](https://github.com/googleapis/java-logging)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`3.22.2` -> `3.22.3` |
|
[com.google.cloud:google-cloud-datastore](https://github.com/googleapis/java-datastore)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.28.0` -> `2.28.1` |
| [com.datadoghq:dd-trace-api](https://github.com/datadog/dd-trace-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`1.48.2` -> `1.49.0` |
| [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.36` -> `2.31.37` |
| [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.36` -> `2.31.37` |
|
[software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.36` -> `2.31.37` |
| [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.36` -> `2.31.37` |
| [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.36` -> `2.31.37` |
| [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.36` -> `2.31.37` |
| [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.36` -> `2.31.37` |

---

### Release Notes

<details>
<summary>googleapis/java-logging
(com.google.cloud:google-cloud-logging)</summary>

###
[`v3.22.3`](https://github.com/googleapis/java-logging/blob/HEAD/CHANGELOG.md#3223-2025-05-06)

##### Bug Fixes

- **deps:** Update the Java code generator (gapic-generator-java) to
2.56.3
([844f4fa](googleapis/java-logging@844f4fa))

##### Dependencies

- Update dependency com.google.cloud:sdk-platform-java-config to v3.46.3
([#&#8203;1801](googleapis/java-logging#1801))
([d7aa7bc](googleapis/java-logging@d7aa7bc))
- Update dependency com.google.cloud:sdk-platform-java-config to v3.47.0
([#&#8203;1803](googleapis/java-logging#1803))
([5967ffe](googleapis/java-logging@5967ffe))
- Update googleapis/sdk-platform-java action to v2.57.0
([#&#8203;1804](googleapis/java-logging#1804))
([e9a27ec](googleapis/java-logging@e9a27ec))

</details>

<details>
<summary>googleapis/java-datastore
(com.google.cloud:google-cloud-datastore)</summary>

###
[`v2.28.1`](https://github.com/googleapis/java-datastore/blob/HEAD/CHANGELOG.md#2281-2025-05-06)

##### Dependencies

- Update dependency com.google.cloud:sdk-platform-java-config to v3.47.0
([#&#8203;1841](googleapis/java-datastore#1841))
([ac393e6](googleapis/java-datastore@ac393e6))
- Update googleapis/sdk-platform-java action to v2.57.0
([#&#8203;1842](googleapis/java-datastore#1842))
([0745906](googleapis/java-datastore@0745906))

</details>

<details>
<summary>datadog/dd-trace-java (com.datadoghq:dd-trace-api)</summary>

###
[`v1.49.0`](https://github.com/DataDog/dd-trace-java/releases/tag/v1.49.0):
1.49.0

### Components

#### Configuration at Runtime

- ✨ Add process tags as list to remote config payload
([#&#8203;8705](DataDog/dd-trace-java#8705) -
[@&#8203;amarziali](https://github.com/amarziali))

#### Continuous Integration Visibility

- 🐛 Add span propagation for Pekko scheduled tasks
([#&#8203;8765](DataDog/dd-trace-java#8765) -
[@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog))
- ✨ Update test.retry_reason to use full name of the feature
([#&#8203;8689](DataDog/dd-trace-java#8689) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- 🧹 Remove unused TestEventsHandler methods
([#&#8203;8674](DataDog/dd-trace-java#8674) -
[@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog))

#### Dynamic Instrumentation

- 🐛 Fix exclude identifiers normalization
([#&#8203;8742](DataDog/dd-trace-java#8742) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- ✨ Make source file tracking asynchronous
([#&#8203;8684](DataDog/dd-trace-java#8684) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- ✨ Add scope filtering for symbol extraction
([#&#8203;8676](DataDog/dd-trace-java#8676) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- ✨ Add support for [@&#8203;key](https://github.com/key) and
[@&#8203;value](https://github.com/value) for Map filtering
([#&#8203;8669](DataDog/dd-trace-java#8669) -
[@&#8203;jpbempel](https://github.com/jpbempel))

#### Library Injection

- ✨ Add system property to force injection of the tracing
library even though multiple javaagents have been detected
([#&#8203;8697](DataDog/dd-trace-java#8697) -
[@&#8203;cecile75](https://github.com/cecile75))

#### Metrics

- ✨ Allow dogstatsd port to be configurable with
DD_DOGSTATSD_PORT
([#&#8203;8693](DataDog/dd-trace-java#8693) -
[@&#8203;randomanderson](https://github.com/randomanderson))

#### Profiling

- ✨ Bump ddprof-java to 1.25.1
([#&#8203;8750](DataDog/dd-trace-java#8750) -
[@&#8203;jbachorik](https://github.com/jbachorik))
- 🐛 Remove cleanup-on-shutdown for temporary files
([#&#8203;8746](DataDog/dd-trace-java#8746) -
[@&#8203;jbachorik](https://github.com/jbachorik))
- ✨⚡ Replace a regex-based SMAP parser with a hand-crafted
one
([#&#8203;8730](DataDog/dd-trace-java#8730) -
[@&#8203;jbachorik](https://github.com/jbachorik))
- ✨ Improve error reporting on profiler startup
([#&#8203;8714](DataDog/dd-trace-java#8714) -
[@&#8203;jbachorik](https://github.com/jbachorik))
- ✨ Exclude ProxyLeakTask exception from exception profiling
([#&#8203;8666](DataDog/dd-trace-java#8666) -
[@&#8203;jbachorik](https://github.com/jbachorik))
- ✨ Use jvmstat for JDKs 9+ programmatically
([#&#8203;8641](DataDog/dd-trace-java#8641) -
[@&#8203;MattAlp](https://github.com/MattAlp))

#### Telemetry

- ✨ Allow dogstatsd port to be configurable with
DD_DOGSTATSD_PORT
([#&#8203;8693](DataDog/dd-trace-java#8693) -
[@&#8203;randomanderson](https://github.com/randomanderson))
- 🐛 Fix appsec.waf.requests telemetry metric
([#&#8203;8644](DataDog/dd-trace-java#8644) -
[@&#8203;jandro996](https://github.com/jandro996))

#### Tracer core

- ✨ Exclude jackson afterburner dynamic classes from
instrumentation
([#&#8203;8747](DataDog/dd-trace-java#8747) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Introduce Java 8 bytecode bridge for instrumentation API
([#&#8203;8736](DataDog/dd-trace-java#8736) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))
- ⚡🧹 Use byte-buddy classes optimized for Java8+
([#&#8203;8735](DataDog/dd-trace-java#8735) -
[@&#8203;mcculls](https://github.com/mcculls))
- 🐛 Do not set the hibernate or datanucleus span service name when
disabled
([#&#8203;8727](DataDog/dd-trace-java#8727) -
[@&#8203;ygree](https://github.com/ygree))
- ✨ Update bytebuddy and ASM to support JDK 24
([#&#8203;8720](DataDog/dd-trace-java#8720) -
[@&#8203;sarahchen6](https://github.com/sarahchen6))
- 🐛 Turn off JDK socket support by default
([#&#8203;8715](DataDog/dd-trace-java#8715) -
[@&#8203;mcculls](https://github.com/mcculls))
- 🐛 Log warning when trace buffer overflow occurs
([#&#8203;8712](DataDog/dd-trace-java#8712) -
[@&#8203;ygree](https://github.com/ygree))
- ✨🧪 Introducing an internal integration name
([#&#8203;8708](DataDog/dd-trace-java#8708) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Add process tags to client stats payload
([#&#8203;8704](DataDog/dd-trace-java#8704) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Collect process tags for tracing
([#&#8203;8698](DataDog/dd-trace-java#8698) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Stable Config file: target system properties in
process_arguments and support template variables in YamlParser
([#&#8203;8690](DataDog/dd-trace-java#8690) -
[@&#8203;mtoffl01](https://github.com/mtoffl01))
- ✨⚡ Use prefix trie for proxy ignores
([#&#8203;8678](DataDog/dd-trace-java#8678) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Allow agent to be automatically injected when running aside
Log4J patch agent
([#&#8203;8648](DataDog/dd-trace-java#8648) -
[@&#8203;paullegranddc](https://github.com/paullegranddc))
- ✨ Use jvmstat for JDKs 9+ programmatically
([#&#8203;8641](DataDog/dd-trace-java#8641) -
[@&#8203;MattAlp](https://github.com/MattAlp))

#### Tracer internal logging

- 🐛 Delete print line
([#&#8203;8686](DataDog/dd-trace-java#8686) -
[@&#8203;sarahchen6](https://github.com/sarahchen6))

### Instrumentations

#### Akka instrumentation

- 🐛 Handle reentrant scope cleanup in Akka/Pekko actor
instrumentations
([#&#8203;8722](DataDog/dd-trace-java#8722) -
[@&#8203;mcculls](https://github.com/mcculls))

#### Apache Spark instrumentation

- ✨ Use OpenLineage root parent information to generate trace
id ([#&#8203;8726](DataDog/dd-trace-java#8726)
- [@&#8203;mobuchowski](https://github.com/mobuchowski))
- ✨ Spark job cancellation no longer marks application as
failed
([#&#8203;8701](DataDog/dd-trace-java#8701) -
[@&#8203;paul-laffon-dd](https://github.com/paul-laffon-dd))

#### JDBC instrumentation

- 💡 Add support for sybase tds jdbc driver
([#&#8203;8764](DataDog/dd-trace-java#8764) -
[@&#8203;amarziali](https://github.com/amarziali))

#### Kotlin instrumentation

- 🐛 Take defensive copy of parent scope stack when closing nested
coroutines
([#&#8203;8749](DataDog/dd-trace-java#8749) -
[@&#8203;mcculls](https://github.com/mcculls))

#### Reactor instrumentation

- ✨⚡ Do not inspect reactor context when not needed
([#&#8203;8745](DataDog/dd-trace-java#8745) -
[@&#8203;amarziali](https://github.com/amarziali))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: 795f347ae34d056efc1194c2f606cee7bca1beea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: kotlin Kotlin instrumentation type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants