Skip to content

Fix SymDB upload dropped requests#7442

Merged
jpbempel merged 2 commits intomasterfrom
jpbempel/fix-symdb-uploads
Aug 28, 2024
Merged

Fix SymDB upload dropped requests#7442
jpbempel merged 2 commits intomasterfrom
jpbempel/fix-symdb-uploads

Conversation

@jpbempel
Copy link
Copy Markdown
Member

@jpbempel jpbempel commented Aug 14, 2024

What Does This Do

SymbolSink was emitting an upload requests for every scope added into the sink queue. As the queue was 1024 entries in capacity we could easily end up in a situation where more than 20 requests are made when draining the Q. to avoid that we are batching the scope together in a single larger upload request and ensure that the sink queue is flushed when full before adding new element and not losing any symbols.

Motivation

avoid dropping SymDB requests

Additional Notes

Contributor Checklist

Jira ticket: DEBUG-2685

@jpbempel jpbempel requested a review from a team as a code owner August 14, 2024 16:44
@jpbempel jpbempel requested review from cimi and removed request for a team August 14, 2024 16:44
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Aug 14, 2024

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1724835805 1724836184
end_time 2024-08-28T09:04:39 2024-08-28T09:10:58
git_branch master jpbempel/fix-symdb-uploads
git_commit_sha 546f797 0ab8bc2
start_time 2024-08-28T09:03:26 2024-08-28T09:09:45
See matching parameters
Baseline Candidate
ci_job_id 619589629 619589629
ci_pipeline_id 43005663 43005663
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1724835273 1724835273

Summary

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

See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-37.961µs; +30.106µs] or [-14.312%; +11.351%]
unstable
[-51.861µs; +43.343µs] or [-17.204%; +14.379%]
unstable
[-61.834µs; +55.105µs] or [-19.631%; +17.495%]
unstable
[-155.549µs; +81.340µs] or [-22.864%; +11.956%]
same
scenario:basic same same same unstable
[-51.125µs; +53.666µs] or [-8.438%; +8.857%]
unstable
[-264.671op/s; +129.718op/s] or [-10.058%; +4.929%]
scenario:loop unsure
[+1.883µs; +20.151µs] or [+0.018%; +0.195%]
same same same same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (301.441 µs) : 249, 354
.   : milestone, 301,
basic (293.392 µs) : 283, 304
.   : milestone, 293,
loop (10.504 ms) : 10485, 10523
.   : milestone, 10504,
section candidate
noprobe (297.182 µs) : 261, 334
.   : milestone, 297,
basic (297.09 µs) : 287, 307
.   : milestone, 297,
loop (10.527 ms) : 10500, 10554
.   : milestone, 10527,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 301.441 µs [248.57 µs, 354.312 µs]
basic 293.392 µs [282.575 µs, 304.21 µs]
loop 10.504 ms [10.485 ms, 10.523 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 297.182 µs [260.7 µs, 333.664 µs]
basic 297.09 µs [287.282 µs, 306.899 µs]
loop 10.527 ms [10.5 ms, 10.554 ms]

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Aug 14, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/fix-symdb-uploads
git_commit_date 1724833012 1724835273
git_commit_sha 546f797 0ab8bc2
release_version 1.39.0-SNAPSHOT~546f7971df 1.39.0-SNAPSHOT~0ab8bc2859
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1724837506 1724837506
ci_job_id 619589623 619589623
ci_pipeline_id 43005663 43005663
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1044807
Total [baseline] (8.486 s) : 0, 8485506
Agent [candidate] (1.048 s) : 0, 1048303
Total [candidate] (8.479 s) : 0, 8478883
section iast
Agent [baseline] (1.172 s) : 0, 1171578
Total [baseline] (8.971 s) : 0, 8970996
Agent [candidate] (1.171 s) : 0, 1171296
Total [candidate] (8.94 s) : 0, 8940289
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.171 s) : 0, 1170761
Total [baseline] (8.96 s) : 0, 8960295
Agent [candidate] (1.182 s) : 0, 1181976
Total [candidate] (8.939 s) : 0, 8939195
section iast_TELEMETRY_OFF
Agent [baseline] (1.178 s) : 0, 1178228
Total [baseline] (8.999 s) : 0, 8998504
Agent [candidate] (1.17 s) : 0, 1170302
Total [candidate] (8.996 s) : 0, 8996495
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.045 s -
Agent iast 1.172 s 126.77 ms (12.1%)
Agent iast_HARDCODED_SECRET_DISABLED 1.171 s 125.953 ms (12.1%)
Agent iast_TELEMETRY_OFF 1.178 s 133.421 ms (12.8%)
Total tracing 8.486 s -
Total iast 8.971 s 485.49 ms (5.7%)
Total iast_HARDCODED_SECRET_DISABLED 8.96 s 474.789 ms (5.6%)
Total iast_TELEMETRY_OFF 8.999 s 512.998 ms (6.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent iast 1.171 s 122.993 ms (11.7%)
Agent iast_HARDCODED_SECRET_DISABLED 1.182 s 133.673 ms (12.8%)
Agent iast_TELEMETRY_OFF 1.17 s 121.999 ms (11.6%)
Total tracing 8.479 s -
Total iast 8.94 s 461.406 ms (5.4%)
Total iast_HARDCODED_SECRET_DISABLED 8.939 s 460.312 ms (5.4%)
Total iast_TELEMETRY_OFF 8.996 s 517.612 ms (6.1%)
gantt
    title insecure-bank - break down per module: candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (666.719 ms) : 0, 666719
BytebuddyAgent [candidate] (669.594 ms) : 0, 669594
GlobalTracer [baseline] (305.114 ms) : 0, 305114
GlobalTracer [candidate] (306.035 ms) : 0, 306035
AppSec [baseline] (51.205 ms) : 0, 51205
AppSec [candidate] (51.075 ms) : 0, 51075
Remote Config [baseline] (664.426 µs) : 0, 664
Remote Config [candidate] (663.142 µs) : 0, 663
Telemetry [baseline] (7.557 ms) : 0, 7557
Telemetry [candidate] (7.441 ms) : 0, 7441
section iast
BytebuddyAgent [baseline] (776.841 ms) : 0, 776841
BytebuddyAgent [candidate] (778.215 ms) : 0, 778215
GlobalTracer [baseline] (295.97 ms) : 0, 295970
GlobalTracer [candidate] (295.838 ms) : 0, 295838
AppSec [baseline] (49.652 ms) : 0, 49652
AppSec [candidate] (51.051 ms) : 0, 51051
IAST [baseline] (24.545 ms) : 0, 24545
IAST [candidate] (23.372 ms) : 0, 23372
Remote Config [baseline] (605.718 µs) : 0, 606
Remote Config [candidate] (595.567 µs) : 0, 596
Telemetry [baseline] (10.395 ms) : 0, 10395
Telemetry [candidate] (8.744 ms) : 0, 8744
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (776.568 ms) : 0, 776568
BytebuddyAgent [candidate] (785.104 ms) : 0, 785104
GlobalTracer [baseline] (295.886 ms) : 0, 295886
GlobalTracer [candidate] (298.481 ms) : 0, 298481
AppSec [baseline] (49.467 ms) : 0, 49467
AppSec [candidate] (54.25 ms) : 0, 54250
IAST [baseline] (25.914 ms) : 0, 25914
IAST [candidate] (22.73 ms) : 0, 22730
Remote Config [baseline] (594.891 µs) : 0, 595
Remote Config [candidate] (591.555 µs) : 0, 592
Telemetry [baseline] (8.766 ms) : 0, 8766
Telemetry [candidate] (7.24 ms) : 0, 7240
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (781.571 ms) : 0, 781571
BytebuddyAgent [candidate] (777.451 ms) : 0, 777451
GlobalTracer [baseline] (297.85 ms) : 0, 297850
GlobalTracer [candidate] (297.143 ms) : 0, 297143
AppSec [baseline] (50.765 ms) : 0, 50765
AppSec [candidate] (52.231 ms) : 0, 52231
IAST [baseline] (25.065 ms) : 0, 25065
IAST [candidate] (22.228 ms) : 0, 22228
Remote Config [baseline] (593.324 µs) : 0, 593
Remote Config [candidate] (577.709 µs) : 0, 578
Telemetry [baseline] (8.682 ms) : 0, 8682
Telemetry [candidate] (7.167 ms) : 0, 7167
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1047719
Total [baseline] (10.385 s) : 0, 10385203
Agent [candidate] (1.049 s) : 0, 1048866
Total [candidate] (10.33 s) : 0, 10329883
section appsec
Agent [baseline] (1.177 s) : 0, 1177129
Total [baseline] (10.543 s) : 0, 10543382
Agent [candidate] (1.175 s) : 0, 1174681
Total [candidate] (10.455 s) : 0, 10455386
section iast
Agent [baseline] (1.173 s) : 0, 1173042
Total [baseline] (10.765 s) : 0, 10764784
Agent [candidate] (1.179 s) : 0, 1179098
Total [candidate] (10.879 s) : 0, 10879116
section profiling
Agent [baseline] (1.258 s) : 0, 1257636
Total [baseline] (10.646 s) : 0, 10646338
Agent [candidate] (1.253 s) : 0, 1252628
Total [candidate] (10.576 s) : 0, 10576352
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent appsec 1.177 s 129.411 ms (12.4%)
Agent iast 1.173 s 125.324 ms (12.0%)
Agent profiling 1.258 s 209.917 ms (20.0%)
Total tracing 10.385 s -
Total appsec 10.543 s 158.179 ms (1.5%)
Total iast 10.765 s 379.581 ms (3.7%)
Total profiling 10.646 s 261.135 ms (2.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.049 s -
Agent appsec 1.175 s 125.815 ms (12.0%)
Agent iast 1.179 s 130.232 ms (12.4%)
Agent profiling 1.253 s 203.761 ms (19.4%)
Total tracing 10.33 s -
Total appsec 10.455 s 125.504 ms (1.2%)
Total iast 10.879 s 549.233 ms (5.3%)
Total profiling 10.576 s 246.47 ms (2.4%)
gantt
    title petclinic - break down per module: candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (668.578 ms) : 0, 668578
BytebuddyAgent [candidate] (669.594 ms) : 0, 669594
GlobalTracer [baseline] (306.338 ms) : 0, 306338
GlobalTracer [candidate] (306.247 ms) : 0, 306247
AppSec [baseline] (51.139 ms) : 0, 51139
AppSec [candidate] (51.393 ms) : 0, 51393
Remote Config [baseline] (657.977 µs) : 0, 658
Remote Config [candidate] (664.769 µs) : 0, 665
Telemetry [baseline] (7.455 ms) : 0, 7455
Telemetry [candidate] (7.464 ms) : 0, 7464
section appsec
BytebuddyAgent [baseline] (683.847 ms) : 0, 683847
BytebuddyAgent [candidate] (681.724 ms) : 0, 681724
GlobalTracer [baseline] (302.479 ms) : 0, 302479
GlobalTracer [candidate] (301.094 ms) : 0, 301094
AppSec [baseline] (160.151 ms) : 0, 160151
AppSec [candidate] (157.293 ms) : 0, 157293
Remote Config [baseline] (636.846 µs) : 0, 637
Remote Config [candidate] (611.678 µs) : 0, 612
Telemetry [baseline] (7.128 ms) : 0, 7128
Telemetry [candidate] (10.009 ms) : 0, 10009
IAST [baseline] (18.435 ms) : 0, 18435
IAST [candidate] (20.817 ms) : 0, 20817
section iast
BytebuddyAgent [baseline] (778.559 ms) : 0, 778559
BytebuddyAgent [candidate] (783.734 ms) : 0, 783734
GlobalTracer [baseline] (296.257 ms) : 0, 296257
GlobalTracer [candidate] (297.497 ms) : 0, 297497
AppSec [baseline] (51.049 ms) : 0, 51049
AppSec [candidate] (53.336 ms) : 0, 53336
Remote Config [baseline] (598.65 µs) : 0, 599
Remote Config [candidate] (584.996 µs) : 0, 585
Telemetry [baseline] (7.895 ms) : 0, 7895
Telemetry [candidate] (7.903 ms) : 0, 7903
IAST [baseline] (25.047 ms) : 0, 25047
IAST [candidate] (22.482 ms) : 0, 22482
section profiling
BytebuddyAgent [baseline] (671.234 ms) : 0, 671234
BytebuddyAgent [candidate] (668.571 ms) : 0, 668571
GlobalTracer [baseline] (392.435 ms) : 0, 392435
GlobalTracer [candidate] (390.665 ms) : 0, 390665
AppSec [baseline] (52.425 ms) : 0, 52425
AppSec [candidate] (52.805 ms) : 0, 52805
Remote Config [baseline] (691.205 µs) : 0, 691
Remote Config [candidate] (689.29 µs) : 0, 689
Telemetry [baseline] (7.414 ms) : 0, 7414
Telemetry [candidate] (7.401 ms) : 0, 7401
ProfilingAgent [baseline] (95.667 ms) : 0, 95667
ProfilingAgent [candidate] (95.01 ms) : 0, 95010
Profiling [baseline] (95.691 ms) : 0, 95691
Profiling [candidate] (95.036 ms) : 0, 95036
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-08-28T09:04:37 2024-08-28T09:11:29
git_branch master jpbempel/fix-symdb-uploads
git_commit_date 1724833012 1724835273
git_commit_sha 546f797 0ab8bc2
release_version 1.39.0-SNAPSHOT~546f7971df 1.39.0-SNAPSHOT~0ab8bc2859
start_time 2024-08-28T09:04:24 2024-08-28T09:11:16
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1724836635 1724836635
ci_job_id 619589624 619589624
ci_pipeline_id 43005663 43005663
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

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

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.348 ms) : 1328, 1368
.   : milestone, 1348,
appsec (1.728 ms) : 1704, 1753
.   : milestone, 1728,
appsec_no_iast (1.768 ms) : 1744, 1791
.   : milestone, 1768,
iast (1.508 ms) : 1486, 1530
.   : milestone, 1508,
profiling (1.512 ms) : 1488, 1537
.   : milestone, 1512,
tracing (1.479 ms) : 1455, 1503
.   : milestone, 1479,
section candidate
no_agent (1.342 ms) : 1323, 1362
.   : milestone, 1342,
appsec (1.723 ms) : 1699, 1748
.   : milestone, 1723,
appsec_no_iast (1.723 ms) : 1698, 1748
.   : milestone, 1723,
iast (1.495 ms) : 1472, 1518
.   : milestone, 1495,
profiling (1.519 ms) : 1493, 1545
.   : milestone, 1519,
tracing (1.475 ms) : 1452, 1499
.   : milestone, 1475,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.348 ms [1.328 ms, 1.368 ms] -
appsec 1.728 ms [1.704 ms, 1.753 ms] 380.143 µs (28.2%)
appsec_no_iast 1.768 ms [1.744 ms, 1.791 ms] 419.644 µs (31.1%)
iast 1.508 ms [1.486 ms, 1.53 ms] 159.938 µs (11.9%)
profiling 1.512 ms [1.488 ms, 1.537 ms] 164.223 µs (12.2%)
tracing 1.479 ms [1.455 ms, 1.503 ms] 130.668 µs (9.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.342 ms [1.323 ms, 1.362 ms] -
appsec 1.723 ms [1.699 ms, 1.748 ms] 381.108 µs (28.4%)
appsec_no_iast 1.723 ms [1.698 ms, 1.748 ms] 380.538 µs (28.3%)
iast 1.495 ms [1.472 ms, 1.518 ms] 152.595 µs (11.4%)
profiling 1.519 ms [1.493 ms, 1.545 ms] 176.539 µs (13.2%)
tracing 1.475 ms [1.452 ms, 1.499 ms] 132.91 µs (9.9%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
    dateFormat X
    axisFormat %s
section baseline
no_agent (373.953 µs) : 354, 394
.   : milestone, 374,
iast (481.252 µs) : 459, 504
.   : milestone, 481,
iast_FULL (556.679 µs) : 536, 578
.   : milestone, 557,
iast_GLOBAL (513.5 µs) : 492, 535
.   : milestone, 514,
iast_HARDCODED_SECRET_DISABLED (491.705 µs) : 469, 514
.   : milestone, 492,
iast_INACTIVE (454.145 µs) : 432, 476
.   : milestone, 454,
iast_TELEMETRY_OFF (483.045 µs) : 460, 506
.   : milestone, 483,
tracing (449.431 µs) : 429, 470
.   : milestone, 449,
section candidate
no_agent (370.929 µs) : 352, 390
.   : milestone, 371,
iast (488.895 µs) : 467, 511
.   : milestone, 489,
iast_FULL (556.294 µs) : 534, 578
.   : milestone, 556,
iast_GLOBAL (510.378 µs) : 488, 533
.   : milestone, 510,
iast_HARDCODED_SECRET_DISABLED (484.932 µs) : 463, 507
.   : milestone, 485,
iast_INACTIVE (448.266 µs) : 428, 469
.   : milestone, 448,
iast_TELEMETRY_OFF (478.975 µs) : 457, 500
.   : milestone, 479,
tracing (438.103 µs) : 418, 459
.   : milestone, 438,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 373.953 µs [354.236 µs, 393.67 µs] -
iast 481.252 µs [458.882 µs, 503.621 µs] 107.299 µs (28.7%)
iast_FULL 556.679 µs [535.61 µs, 577.749 µs] 182.726 µs (48.9%)
iast_GLOBAL 513.5 µs [491.889 µs, 535.112 µs] 139.548 µs (37.3%)
iast_HARDCODED_SECRET_DISABLED 491.705 µs [469.139 µs, 514.271 µs] 117.752 µs (31.5%)
iast_INACTIVE 454.145 µs [432.397 µs, 475.893 µs] 80.192 µs (21.4%)
iast_TELEMETRY_OFF 483.045 µs [460.106 µs, 505.984 µs] 109.092 µs (29.2%)
tracing 449.431 µs [428.971 µs, 469.89 µs] 75.478 µs (20.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 370.929 µs [351.616 µs, 390.242 µs] -
iast 488.895 µs [466.83 µs, 510.96 µs] 117.966 µs (31.8%)
iast_FULL 556.294 µs [534.272 µs, 578.316 µs] 185.365 µs (50.0%)
iast_GLOBAL 510.378 µs [487.806 µs, 532.95 µs] 139.449 µs (37.6%)
iast_HARDCODED_SECRET_DISABLED 484.932 µs [462.544 µs, 507.32 µs] 114.003 µs (30.7%)
iast_INACTIVE 448.266 µs [427.654 µs, 468.879 µs] 77.337 µs (20.8%)
iast_TELEMETRY_OFF 478.975 µs [457.458 µs, 500.493 µs] 108.047 µs (29.1%)
tracing 438.103 µs [417.669 µs, 458.536 µs] 67.174 µs (18.1%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/fix-symdb-uploads
git_commit_date 1724833012 1724835273
git_commit_sha 546f797 0ab8bc2
release_version 1.39.0-SNAPSHOT~546f7971df 1.39.0-SNAPSHOT~0ab8bc2859
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1724837153 1724837153
ci_job_id 619589625 619589625
ci_pipeline_id 43005663 43005663
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
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 tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.448 ms) : 1437, 1459
.   : milestone, 1448,
appsec (2.213 ms) : 2178, 2248
.   : milestone, 2213,
iast (1.981 ms) : 1937, 2025
.   : milestone, 1981,
iast_GLOBAL (2.015 ms) : 1971, 2059
.   : milestone, 2015,
profiling (1.851 ms) : 1815, 1887
.   : milestone, 1851,
tracing (1.828 ms) : 1796, 1861
.   : milestone, 1828,
section candidate
no_agent (1.45 ms) : 1439, 1462
.   : milestone, 1450,
appsec (2.207 ms) : 2172, 2241
.   : milestone, 2207,
iast (1.953 ms) : 1911, 1995
.   : milestone, 1953,
iast_GLOBAL (2.009 ms) : 1965, 2052
.   : milestone, 2009,
profiling (1.857 ms) : 1822, 1893
.   : milestone, 1857,
tracing (1.822 ms) : 1790, 1855
.   : milestone, 1822,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.448 ms [1.437 ms, 1.459 ms] -
appsec 2.213 ms [2.178 ms, 2.248 ms] 765.165 µs (52.8%)
iast 1.981 ms [1.937 ms, 2.025 ms] 532.59 µs (36.8%)
iast_GLOBAL 2.015 ms [1.971 ms, 2.059 ms] 566.966 µs (39.2%)
profiling 1.851 ms [1.815 ms, 1.887 ms] 403.118 µs (27.8%)
tracing 1.828 ms [1.796 ms, 1.861 ms] 380.103 µs (26.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.45 ms [1.439 ms, 1.462 ms] -
appsec 2.207 ms [2.172 ms, 2.241 ms] 756.218 µs (52.1%)
iast 1.953 ms [1.911 ms, 1.995 ms] 502.486 µs (34.6%)
iast_GLOBAL 2.009 ms [1.965 ms, 2.052 ms] 558.291 µs (38.5%)
profiling 1.857 ms [1.822 ms, 1.893 ms] 406.825 µs (28.1%)
tracing 1.822 ms [1.79 ms, 1.855 ms] 371.721 µs (25.6%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.986 s) : 14986000, 14986000
.   : milestone, 14986000,
appsec (14.938 s) : 14938000, 14938000
.   : milestone, 14938000,
iast (18.684 s) : 18684000, 18684000
.   : milestone, 18684000,
iast_GLOBAL (17.959 s) : 17959000, 17959000
.   : milestone, 17959000,
profiling (14.857 s) : 14857000, 14857000
.   : milestone, 14857000,
tracing (15.221 s) : 15221000, 15221000
.   : milestone, 15221000,
section candidate
no_agent (14.834 s) : 14834000, 14834000
.   : milestone, 14834000,
appsec (15.066 s) : 15066000, 15066000
.   : milestone, 15066000,
iast (18.85 s) : 18850000, 18850000
.   : milestone, 18850000,
iast_GLOBAL (17.947 s) : 17947000, 17947000
.   : milestone, 17947000,
profiling (14.792 s) : 14792000, 14792000
.   : milestone, 14792000,
tracing (15.096 s) : 15096000, 15096000
.   : milestone, 15096000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.986 s [14.986 s, 14.986 s] -
appsec 14.938 s [14.938 s, 14.938 s] -48.0 ms (-0.3%)
iast 18.684 s [18.684 s, 18.684 s] 3.698 s (24.7%)
iast_GLOBAL 17.959 s [17.959 s, 17.959 s] 2.973 s (19.8%)
profiling 14.857 s [14.857 s, 14.857 s] -129.0 ms (-0.9%)
tracing 15.221 s [15.221 s, 15.221 s] 235.0 ms (1.6%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.834 s [14.834 s, 14.834 s] -
appsec 15.066 s [15.066 s, 15.066 s] 232.0 ms (1.6%)
iast 18.85 s [18.85 s, 18.85 s] 4.016 s (27.1%)
iast_GLOBAL 17.947 s [17.947 s, 17.947 s] 3.113 s (21.0%)
profiling 14.792 s [14.792 s, 14.792 s] -42.0 ms (-0.3%)
tracing 15.096 s [15.096 s, 15.096 s] 262.0 ms (1.8%)

@jpbempel jpbempel added comp: debugger Dynamic Instrumentation type: bug Bug report and fix labels Aug 16, 2024
SymbolSink was emitting an upload requests for every scope added into
the sink queue. As the queue was 1024 entries in capacity we could
easily end up in a situation where more than 20 requests are made
when draining the Q. to avoid that we are batching the scope together
in a single larger upload request and ensure that the sink queue is
flushed when full before adding new element and not losing any
symbols.
@jpbempel jpbempel force-pushed the jpbempel/fix-symdb-uploads branch from 13847ca to 879253c Compare August 23, 2024 14:04

public boolean addScope(Scope jarScope) {
public void addScope(Scope jarScope) {
ServiceVersion serviceVersion =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure why we create ServiceVersion here and then break it down into scopes in flush to only build a ServiceVersion again with all the scopes. maybe we should store Scope instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

true it's useless, removed

} catch (Exception e) {
ExceptionHelper.logException(LOGGER, e, "Error during scope serialization:");
}
allScopes.addAll(serviceVersion.getScopes());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: add classCount += serviceVersion.getScopes().get(0).getScopes().size() here and avoid the updateStat function below?

Even better, if we just keep everything as jarScope, maybe we add method getScopesCount() and make the code more readable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removing ServiceVersion make it simpler.
simplify by adding the getScopeCount method, but updateStats method stays

int retries = 10;
while (!added) {
// Q is full, flushing synchronously
flush();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is interesting... and might cause a problem, but I'm not sure.

The way I understand the logic here:

  1. the symbol transformer is get called. with the class byte buffer.
  2. symbol Aggregator then parse it and generate scopes.
  3. then it ofer it to the sync, which until now was async.
  4. the transformer return the original bytes.

With this change, the transformer will not return until the queue is flashed, which is blocking the class from been loaded. so, In case of network delay or problems - would that cause the application to freeze?

if we go back to async mode - not sure how we dropped messages as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the flush make upload http requests, but http requests are sent async in OkHttp component.

List<ServiceVersion> scopesToSerialize = new ArrayList<>();
// ArrayBlockingQueue makes drainTo atomic, so it is safe to call flush from different and
// concurrent threads
scopes.drainTo(scopesToSerialize);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe we should check scopesToSerialize is empty just return

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

@jpbempel jpbempel merged commit f152e54 into master Aug 28, 2024
@jpbempel jpbempel deleted the jpbempel/fix-symdb-uploads branch August 28, 2024 10:10
@github-actions github-actions Bot added this to the 1.39.0 milestone Aug 28, 2024
Copy link
Copy Markdown
Member

@ojung ojung left a comment

Choose a reason for hiding this comment

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

The way I understand these changes, we could still end up with more than 20 concurrent requests: When there are (20 + 1) * 1024 classes loaded at roughly the same time. Please correct me if I'm wrong or this isn't a concern.

return scopes.offer(serviceVersion);
public void addScope(Scope jarScope) {
boolean added = scopes.offer(jarScope);
int retries = 10;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why might we need to retry more than once if flush() is synchronous?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

concurrency at the best: this flushing process is in background thread, and still (but unlikely) threads are loading a lot of classes/jars and we filling up again the Q while flushing the previous batch, we are trying again to flush.

Flush is synchronous, but we are still allowing to add to the queue once drained.

@jpbempel
Copy link
Copy Markdown
Member Author

jpbempel commented Sep 2, 2024

The way I understand these changes, we could still end up with more than 20 concurrent requests: When there are (20 + 1) * 1024 classes loaded at roughly the same time. Please correct me if I'm wrong or this isn't a concern.

That's almost true, except that top level scopes are aggregated by jar name, en so each entry in the Queue is a different jar. So you need (20+1) *1024 different jars for that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: debugger Dynamic Instrumentation type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants