Skip to content
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

Fix exception handling for SQL Server full mode #7405

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

nenadnoveljic
Copy link
Contributor

What Does This Do

Finish span in the finally block to avoid leaks after exceptions.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@nenadnoveljic nenadnoveljic requested a review from a team as a code owner August 9, 2024 02:47
@pr-commenter
Copy link

pr-commenter bot commented Aug 9, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master nenadnoveljic/sqlserver-fix-exception-handling
git_commit_date 1723194941 1723217535
git_commit_sha 23ce5ef 2675ae1
release_version 1.39.0-SNAPSHOT~23ce5ef2d1 1.39.0-SNAPSHOT~2675ae1381
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1723219914 1723219914
ci_job_id 600385715 600385715
ci_pipeline_id 41348393 41348393
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~2675ae1381, baseline=1.39.0-SNAPSHOT~23ce5ef2d1

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1047944
Total [baseline] (8.488 s) : 0, 8487543
Agent [candidate] (1.055 s) : 0, 1055243
Total [candidate] (8.502 s) : 0, 8501875
section iast
Agent [baseline] (1.178 s) : 0, 1177604
Total [baseline] (8.993 s) : 0, 8992683
Agent [candidate] (1.187 s) : 0, 1186975
Total [candidate] (8.997 s) : 0, 8996730
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.178 s) : 0, 1178441
Total [baseline] (8.952 s) : 0, 8951693
Agent [candidate] (1.179 s) : 0, 1178594
Total [candidate] (8.954 s) : 0, 8954260
section iast_TELEMETRY_OFF
Agent [baseline] (1.173 s) : 0, 1173207
Total [baseline] (9.006 s) : 0, 9005623
Agent [candidate] (1.172 s) : 0, 1172163
Total [candidate] (8.954 s) : 0, 8953632
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent iast 1.178 s 129.66 ms (12.4%)
Agent iast_HARDCODED_SECRET_DISABLED 1.178 s 130.497 ms (12.5%)
Agent iast_TELEMETRY_OFF 1.173 s 125.263 ms (12.0%)
Total tracing 8.488 s -
Total iast 8.993 s 505.14 ms (6.0%)
Total iast_HARDCODED_SECRET_DISABLED 8.952 s 464.15 ms (5.5%)
Total iast_TELEMETRY_OFF 9.006 s 518.08 ms (6.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.055 s -
Agent iast 1.187 s 131.732 ms (12.5%)
Agent iast_HARDCODED_SECRET_DISABLED 1.179 s 123.352 ms (11.7%)
Agent iast_TELEMETRY_OFF 1.172 s 116.92 ms (11.1%)
Total tracing 8.502 s -
Total iast 8.997 s 494.855 ms (5.8%)
Total iast_HARDCODED_SECRET_DISABLED 8.954 s 452.385 ms (5.3%)
Total iast_TELEMETRY_OFF 8.954 s 451.757 ms (5.3%)
gantt
    title insecure-bank - break down per module: candidate=1.39.0-SNAPSHOT~2675ae1381, baseline=1.39.0-SNAPSHOT~23ce5ef2d1

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (668.678 ms) : 0, 668678
BytebuddyAgent [candidate] (673.712 ms) : 0, 673712
GlobalTracer [baseline] (306.737 ms) : 0, 306737
GlobalTracer [candidate] (309.101 ms) : 0, 309101
AppSec [baseline] (51.002 ms) : 0, 51002
AppSec [candidate] (50.764 ms) : 0, 50764
Remote Config [baseline] (708.304 µs) : 0, 708
Remote Config [candidate] (698.28 µs) : 0, 698
Telemetry [baseline] (7.373 ms) : 0, 7373
Telemetry [candidate] (7.438 ms) : 0, 7438
section iast
BytebuddyAgent [baseline] (783.274 ms) : 0, 783274
BytebuddyAgent [candidate] (789.921 ms) : 0, 789921
GlobalTracer [baseline] (296.947 ms) : 0, 296947
GlobalTracer [candidate] (298.642 ms) : 0, 298642
AppSec [baseline] (51.284 ms) : 0, 51284
AppSec [candidate] (50.619 ms) : 0, 50619
IAST [baseline] (23.381 ms) : 0, 23381
IAST [candidate] (24.725 ms) : 0, 24725
Remote Config [baseline] (586.806 µs) : 0, 587
Remote Config [candidate] (607.971 µs) : 0, 608
Telemetry [baseline] (8.635 ms) : 0, 8635
Telemetry [candidate] (8.858 ms) : 0, 8858
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (783.226 ms) : 0, 783226
BytebuddyAgent [candidate] (784.559 ms) : 0, 784559
GlobalTracer [baseline] (297.532 ms) : 0, 297532
GlobalTracer [candidate] (298.049 ms) : 0, 298049
AppSec [baseline] (49.711 ms) : 0, 49711
AppSec [candidate] (48.785 ms) : 0, 48785
IAST [baseline] (26.043 ms) : 0, 26043
IAST [candidate] (22.667 ms) : 0, 22667
Remote Config [baseline] (593.743 µs) : 0, 594
Remote Config [candidate] (593.448 µs) : 0, 593
Telemetry [baseline] (7.761 ms) : 0, 7761
Telemetry [candidate] (10.377 ms) : 0, 10377
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (780.088 ms) : 0, 780088
BytebuddyAgent [candidate] (779.766 ms) : 0, 779766
GlobalTracer [baseline] (296.994 ms) : 0, 296994
GlobalTracer [candidate] (297.104 ms) : 0, 297104
AppSec [baseline] (50.066 ms) : 0, 50066
AppSec [candidate] (46.894 ms) : 0, 46894
IAST [baseline] (24.316 ms) : 0, 24316
IAST [candidate] (27.407 ms) : 0, 27407
Remote Config [baseline] (598.796 µs) : 0, 599
Remote Config [candidate] (605.168 µs) : 0, 605
Telemetry [baseline] (7.623 ms) : 0, 7623
Telemetry [candidate] (6.859 ms) : 0, 6859
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.39.0-SNAPSHOT~2675ae1381, baseline=1.39.0-SNAPSHOT~23ce5ef2d1

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.046 s) : 0, 1046172
Total [baseline] (10.262 s) : 0, 10261825
Agent [candidate] (1.048 s) : 0, 1047814
Total [candidate] (10.343 s) : 0, 10342986
section appsec
Agent [baseline] (1.174 s) : 0, 1173978
Total [baseline] (10.5 s) : 0, 10499586
Agent [candidate] (1.166 s) : 0, 1166179
Total [candidate] (10.495 s) : 0, 10495189
section iast
Agent [baseline] (1.175 s) : 0, 1175020
Total [baseline] (10.755 s) : 0, 10754770
Agent [candidate] (1.175 s) : 0, 1175395
Total [candidate] (10.778 s) : 0, 10777826
section profiling
Agent [baseline] (1.245 s) : 0, 1244954
Total [baseline] (10.578 s) : 0, 10578337
Agent [candidate] (1.245 s) : 0, 1244676
Total [candidate] (10.593 s) : 0, 10592647
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.046 s -
Agent appsec 1.174 s 127.805 ms (12.2%)
Agent iast 1.175 s 128.847 ms (12.3%)
Agent profiling 1.245 s 198.782 ms (19.0%)
Total tracing 10.262 s -
Total appsec 10.5 s 237.761 ms (2.3%)
Total iast 10.755 s 492.945 ms (4.8%)
Total profiling 10.578 s 316.512 ms (3.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent appsec 1.166 s 118.365 ms (11.3%)
Agent iast 1.175 s 127.581 ms (12.2%)
Agent profiling 1.245 s 196.862 ms (18.8%)
Total tracing 10.343 s -
Total appsec 10.495 s 152.203 ms (1.5%)
Total iast 10.778 s 434.841 ms (4.2%)
Total profiling 10.593 s 249.661 ms (2.4%)
gantt
    title petclinic - break down per module: candidate=1.39.0-SNAPSHOT~2675ae1381, baseline=1.39.0-SNAPSHOT~23ce5ef2d1

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (667.494 ms) : 0, 667494
BytebuddyAgent [candidate] (668.61 ms) : 0, 668610
GlobalTracer [baseline] (306.528 ms) : 0, 306528
GlobalTracer [candidate] (307.059 ms) : 0, 307059
AppSec [baseline] (50.735 ms) : 0, 50735
AppSec [candidate] (50.559 ms) : 0, 50559
Remote Config [baseline] (684.23 µs) : 0, 684
Remote Config [candidate] (693.058 µs) : 0, 693
Telemetry [baseline] (7.292 ms) : 0, 7292
Telemetry [candidate] (7.413 ms) : 0, 7413
section appsec
BytebuddyAgent [baseline] (682.263 ms) : 0, 682263
BytebuddyAgent [candidate] (678.533 ms) : 0, 678533
GlobalTracer [baseline] (301.93 ms) : 0, 301930
GlobalTracer [candidate] (300.339 ms) : 0, 300339
AppSec [baseline] (156.568 ms) : 0, 156568
AppSec [candidate] (155.128 ms) : 0, 155128
IAST [baseline] (20.967 ms) : 0, 20967
IAST [candidate] (19.646 ms) : 0, 19646
Remote Config [baseline] (616.491 µs) : 0, 616
Remote Config [candidate] (610.019 µs) : 0, 610
Telemetry [baseline] (8.547 ms) : 0, 8547
Telemetry [candidate] (8.217 ms) : 0, 8217
section iast
BytebuddyAgent [baseline] (782.177 ms) : 0, 782177
BytebuddyAgent [candidate] (782.581 ms) : 0, 782581
GlobalTracer [baseline] (296.41 ms) : 0, 296410
GlobalTracer [candidate] (296.464 ms) : 0, 296464
AppSec [baseline] (51.267 ms) : 0, 51267
AppSec [candidate] (52.538 ms) : 0, 52538
IAST [baseline] (21.694 ms) : 0, 21694
IAST [candidate] (22.69 ms) : 0, 22690
Remote Config [baseline] (579.883 µs) : 0, 580
Remote Config [candidate] (578.721 µs) : 0, 579
Telemetry [baseline] (9.369 ms) : 0, 9369
Telemetry [candidate] (7.041 ms) : 0, 7041
section profiling
BytebuddyAgent [baseline] (664.104 ms) : 0, 664104
BytebuddyAgent [candidate] (663.228 ms) : 0, 663228
GlobalTracer [baseline] (389.955 ms) : 0, 389955
GlobalTracer [candidate] (391.207 ms) : 0, 391207
AppSec [baseline] (51.514 ms) : 0, 51514
AppSec [candidate] (50.973 ms) : 0, 50973
Remote Config [baseline] (693.44 µs) : 0, 693
Remote Config [candidate] (684.339 µs) : 0, 684
Telemetry [baseline] (7.217 ms) : 0, 7217
Telemetry [candidate] (7.196 ms) : 0, 7196
ProfilingAgent [baseline] (94.274 ms) : 0, 94274
ProfilingAgent [candidate] (94.221 ms) : 0, 94221
Profiling [baseline] (94.299 ms) : 0, 94299
Profiling [candidate] (94.245 ms) : 0, 94245
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-08-09T15:42:44 2024-08-09T15:49:34
git_branch master nenadnoveljic/sqlserver-fix-exception-handling
git_commit_date 1723194941 1723217535
git_commit_sha 23ce5ef 2675ae1
release_version 1.39.0-SNAPSHOT~23ce5ef2d1 1.39.0-SNAPSHOT~2675ae1381
start_time 2024-08-09T15:42:31 2024-08-09T15:49:20
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1723218917 1723218917
ci_job_id 600385716 600385716
ci_pipeline_id 41348393 41348393
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 11 metrics, 17 unstable metrics.

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~2675ae1381, baseline=1.39.0-SNAPSHOT~23ce5ef2d1
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.348 ms) : 1329, 1367
.   : milestone, 1348,
appsec (1.701 ms) : 1679, 1723
.   : milestone, 1701,
appsec_no_iast (1.722 ms) : 1695, 1749
.   : milestone, 1722,
iast (1.488 ms) : 1465, 1510
.   : milestone, 1488,
profiling (1.53 ms) : 1504, 1556
.   : milestone, 1530,
tracing (1.458 ms) : 1433, 1483
.   : milestone, 1458,
section candidate
no_agent (1.343 ms) : 1324, 1362
.   : milestone, 1343,
appsec (1.713 ms) : 1688, 1737
.   : milestone, 1713,
appsec_no_iast (1.702 ms) : 1677, 1726
.   : milestone, 1702,
iast (1.459 ms) : 1437, 1482
.   : milestone, 1459,
profiling (1.472 ms) : 1448, 1497
.   : milestone, 1472,
tracing (1.466 ms) : 1439, 1494
.   : milestone, 1466,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.348 ms [1.329 ms, 1.367 ms] -
appsec 1.701 ms [1.679 ms, 1.723 ms] 352.923 µs (26.2%)
appsec_no_iast 1.722 ms [1.695 ms, 1.749 ms] 373.732 µs (27.7%)
iast 1.488 ms [1.465 ms, 1.51 ms] 139.657 µs (10.4%)
profiling 1.53 ms [1.504 ms, 1.556 ms] 181.817 µs (13.5%)
tracing 1.458 ms [1.433 ms, 1.483 ms] 109.954 µs (8.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.343 ms [1.324 ms, 1.362 ms] -
appsec 1.713 ms [1.688 ms, 1.737 ms] 369.575 µs (27.5%)
appsec_no_iast 1.702 ms [1.677 ms, 1.726 ms] 358.518 µs (26.7%)
iast 1.459 ms [1.437 ms, 1.482 ms] 116.045 µs (8.6%)
profiling 1.472 ms [1.448 ms, 1.497 ms] 129.122 µs (9.6%)
tracing 1.466 ms [1.439 ms, 1.494 ms] 123.301 µs (9.2%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~2675ae1381, baseline=1.39.0-SNAPSHOT~23ce5ef2d1
    dateFormat X
    axisFormat %s
section baseline
no_agent (368.487 µs) : 349, 388
.   : milestone, 368,
iast (480.992 µs) : 460, 502
.   : milestone, 481,
iast_FULL (550.642 µs) : 530, 572
.   : milestone, 551,
iast_GLOBAL (505.865 µs) : 484, 528
.   : milestone, 506,
iast_HARDCODED_SECRET_DISABLED (489.928 µs) : 468, 512
.   : milestone, 490,
iast_INACTIVE (446.225 µs) : 425, 467
.   : milestone, 446,
iast_TELEMETRY_OFF (466.947 µs) : 446, 488
.   : milestone, 467,
tracing (439.77 µs) : 419, 460
.   : milestone, 440,
section candidate
no_agent (363.266 µs) : 343, 383
.   : milestone, 363,
iast (476.419 µs) : 455, 498
.   : milestone, 476,
iast_FULL (547.875 µs) : 527, 569
.   : milestone, 548,
iast_GLOBAL (501.407 µs) : 480, 523
.   : milestone, 501,
iast_HARDCODED_SECRET_DISABLED (481.057 µs) : 460, 502
.   : milestone, 481,
iast_INACTIVE (451.071 µs) : 430, 472
.   : milestone, 451,
iast_TELEMETRY_OFF (473.502 µs) : 452, 495
.   : milestone, 474,
tracing (442.285 µs) : 422, 463
.   : milestone, 442,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 368.487 µs [348.91 µs, 388.064 µs] -
iast 480.992 µs [459.659 µs, 502.324 µs] 112.505 µs (30.5%)
iast_FULL 550.642 µs [529.56 µs, 571.724 µs] 182.155 µs (49.4%)
iast_GLOBAL 505.865 µs [484.045 µs, 527.685 µs] 137.378 µs (37.3%)
iast_HARDCODED_SECRET_DISABLED 489.928 µs [468.277 µs, 511.58 µs] 121.441 µs (33.0%)
iast_INACTIVE 446.225 µs [425.256 µs, 467.194 µs] 77.738 µs (21.1%)
iast_TELEMETRY_OFF 466.947 µs [445.965 µs, 487.93 µs] 98.46 µs (26.7%)
tracing 439.77 µs [419.407 µs, 460.132 µs] 71.283 µs (19.3%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 363.266 µs [343.318 µs, 383.214 µs] -
iast 476.419 µs [455.189 µs, 497.649 µs] 113.153 µs (31.1%)
iast_FULL 547.875 µs [526.758 µs, 568.993 µs] 184.61 µs (50.8%)
iast_GLOBAL 501.407 µs [479.992 µs, 522.822 µs] 138.141 µs (38.0%)
iast_HARDCODED_SECRET_DISABLED 481.057 µs [459.877 µs, 502.237 µs] 117.791 µs (32.4%)
iast_INACTIVE 451.071 µs [429.807 µs, 472.335 µs] 87.805 µs (24.2%)
iast_TELEMETRY_OFF 473.502 µs [452.191 µs, 494.812 µs] 110.236 µs (30.3%)
tracing 442.285 µs [421.738 µs, 462.832 µs] 79.019 µs (21.8%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master nenadnoveljic/sqlserver-fix-exception-handling
git_commit_date 1723194941 1723217535
git_commit_sha 23ce5ef 2675ae1
release_version 1.39.0-SNAPSHOT~23ce5ef2d1 1.39.0-SNAPSHOT~2675ae1381
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1723219443 1723219443
ci_job_id 600385717 600385717
ci_pipeline_id 41348393 41348393
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~2675ae1381, baseline=1.39.0-SNAPSHOT~23ce5ef2d1
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.462 ms) : 1451, 1474
.   : milestone, 1462,
appsec (2.222 ms) : 2188, 2257
.   : milestone, 2222,
iast (1.961 ms) : 1920, 2003
.   : milestone, 1961,
iast_GLOBAL (2.03 ms) : 1986, 2073
.   : milestone, 2030,
profiling (1.869 ms) : 1835, 1903
.   : milestone, 1869,
tracing (1.859 ms) : 1826, 1892
.   : milestone, 1859,
section candidate
no_agent (1.467 ms) : 1455, 1478
.   : milestone, 1467,
appsec (2.225 ms) : 2190, 2261
.   : milestone, 2225,
iast (1.979 ms) : 1937, 2021
.   : milestone, 1979,
iast_GLOBAL (2.029 ms) : 1985, 2072
.   : milestone, 2029,
profiling (1.876 ms) : 1841, 1911
.   : milestone, 1876,
tracing (1.846 ms) : 1813, 1879
.   : milestone, 1846,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.462 ms [1.451 ms, 1.474 ms] -
appsec 2.222 ms [2.188 ms, 2.257 ms] 760.0 µs (52.0%)
iast 1.961 ms [1.92 ms, 2.003 ms] 499.245 µs (34.1%)
iast_GLOBAL 2.03 ms [1.986 ms, 2.073 ms] 567.336 µs (38.8%)
profiling 1.869 ms [1.835 ms, 1.903 ms] 406.845 µs (27.8%)
tracing 1.859 ms [1.826 ms, 1.892 ms] 396.598 µs (27.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.467 ms [1.455 ms, 1.478 ms] -
appsec 2.225 ms [2.19 ms, 2.261 ms] 758.577 µs (51.7%)
iast 1.979 ms [1.937 ms, 2.021 ms] 511.852 µs (34.9%)
iast_GLOBAL 2.029 ms [1.985 ms, 2.072 ms] 561.68 µs (38.3%)
profiling 1.876 ms [1.841 ms, 1.911 ms] 408.936 µs (27.9%)
tracing 1.846 ms [1.813 ms, 1.879 ms] 379.128 µs (25.8%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~2675ae1381, baseline=1.39.0-SNAPSHOT~23ce5ef2d1
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.964 s) : 14964000, 14964000
.   : milestone, 14964000,
appsec (15.003 s) : 15003000, 15003000
.   : milestone, 15003000,
iast (18.847 s) : 18847000, 18847000
.   : milestone, 18847000,
iast_GLOBAL (17.787 s) : 17787000, 17787000
.   : milestone, 17787000,
profiling (15.144 s) : 15144000, 15144000
.   : milestone, 15144000,
tracing (15.28 s) : 15280000, 15280000
.   : milestone, 15280000,
section candidate
no_agent (15.521 s) : 15521000, 15521000
.   : milestone, 15521000,
appsec (15.07 s) : 15070000, 15070000
.   : milestone, 15070000,
iast (18.828 s) : 18828000, 18828000
.   : milestone, 18828000,
iast_GLOBAL (17.906 s) : 17906000, 17906000
.   : milestone, 17906000,
profiling (15.322 s) : 15322000, 15322000
.   : milestone, 15322000,
tracing (14.997 s) : 14997000, 14997000
.   : milestone, 14997000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.964 s [14.964 s, 14.964 s] -
appsec 15.003 s [15.003 s, 15.003 s] 39.0 ms (0.3%)
iast 18.847 s [18.847 s, 18.847 s] 3.883 s (25.9%)
iast_GLOBAL 17.787 s [17.787 s, 17.787 s] 2.823 s (18.9%)
profiling 15.144 s [15.144 s, 15.144 s] 180.0 ms (1.2%)
tracing 15.28 s [15.28 s, 15.28 s] 316.0 ms (2.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.521 s [15.521 s, 15.521 s] -
appsec 15.07 s [15.07 s, 15.07 s] -451.0 ms (-2.9%)
iast 18.828 s [18.828 s, 18.828 s] 3.307 s (21.3%)
iast_GLOBAL 17.906 s [17.906 s, 17.906 s] 2.385 s (15.4%)
profiling 15.322 s [15.322 s, 15.322 s] -199.0 ms (-1.3%)
tracing 14.997 s [14.997 s, 14.997 s] -524.0 ms (-3.4%)

Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

Hi @nenadnoveljic

I don't follow your changes compared to the PR description "Finish span in the finally block to avoid leaks after exceptions.". Can you elaborate a bit more but here is what I understand:

First, if there is an exception from statement closure, it will be caught and the span will still finish.
Then, you reduce the exception catch scope from Exception to SQLException so you will be catching fewer kinds of issues. It is expected?
Finally, you are no more closing the span if the instrumentedStatement is null, so you will be leaking more spans.

@PerfectSlayer PerfectSlayer added type: bug inst: jdbc JDBC instrumentation labels Aug 9, 2024
vandonr
vandonr previously approved these changes Aug 9, 2024
@PerfectSlayer
Copy link
Contributor

@vandonr As you approved the changes, can you help me with the concerns I raise in the comment above?

@vandonr
Copy link
Contributor

vandonr commented Aug 9, 2024

@vandonr As you approved the changes, can you help me with the concerns I raise in the comment above?

Hmm, yeah, so this PR is stemming from this comment on a previous PR.

Actually I read the code a bit too fast without seeing your comment, but you are right, this is too high, I think we need yet another finally block a bit lower :(

@nenadnoveljic
Copy link
Contributor Author

Hi @nenadnoveljic

I don't follow your changes compared to the PR description "Finish span in the finally block to avoid leaks after exceptions.". Can you elaborate a bit more but here is what I understand:

First, if there is an exception from statement closure, it will be caught and the span will still finish. Then, you reduce the exception catch scope from Exception to SQLException so you will be catching fewer kinds of issues. It is expected? Finally, you are no more closing the span if the instrumentedStatement is null, so you will be leaking more spans.

Thanks for catching it. I implemented the nested exception handling now.

Copy link
Contributor

@vandonr vandonr left a comment

Choose a reason for hiding this comment

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

lgtm now

Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and the discussion about Exception/Throwable! 👍

@nenadnoveljic nenadnoveljic merged commit 0e0a715 into master Aug 12, 2024
80 checks passed
@nenadnoveljic nenadnoveljic deleted the nenadnoveljic/sqlserver-fix-exception-handling branch August 12, 2024 07:31
@github-actions github-actions bot added this to the 1.39.0 milestone Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: jdbc JDBC instrumentation type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants