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

Finish netty span when request is cancelled #7900

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

amarziali
Copy link
Collaborator

@amarziali amarziali commented Nov 6, 2024

What Does This Do

When a netty server request is cancelled the root span is not finished.
This PR ensure that the root span is finished is yet incomplete when the channel is inactive otherwise the full trace won't be flushed out.

Solves #3503

Motivation

Additional Notes

Contributor Checklist

Jira ticket: APMS-13662

@amarziali amarziali added type: bug inst: netty Netty instrumentation labels Nov 6, 2024
@amarziali amarziali requested a review from a team as a code owner November 6, 2024 16:54
@pr-commenter
Copy link

pr-commenter bot commented Nov 6, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/netty-cancel
git_commit_date 1730965224 1730972617
git_commit_sha 8e1ab2b 8da33a7
release_version 1.43.0-SNAPSHOT~8e1ab2bcd8 1.43.0-SNAPSHOT~8da33a7b92
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1730975058 1730975058
ci_job_id 698594740 698594740
ci_pipeline_id 48430540 48430540
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 54 metrics, 9 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.43.0-SNAPSHOT~8da33a7b92, baseline=1.43.0-SNAPSHOT~8e1ab2bcd8

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.093 s) : 0, 1092883
Total [baseline] (8.596 s) : 0, 8596420
Agent [candidate] (1.086 s) : 0, 1085588
Total [candidate] (8.567 s) : 0, 8566732
section iast
Agent [baseline] (1.209 s) : 0, 1209013
Total [baseline] (9.156 s) : 0, 9155761
Agent [candidate] (1.207 s) : 0, 1207194
Total [candidate] (9.141 s) : 0, 9141333
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.215 s) : 0, 1215183
Total [baseline] (9.093 s) : 0, 9093457
Agent [candidate] (1.218 s) : 0, 1217526
Total [candidate] (9.121 s) : 0, 9121068
section iast_TELEMETRY_OFF
Agent [baseline] (1.21 s) : 0, 1209718
Total [baseline] (9.114 s) : 0, 9113701
Agent [candidate] (1.207 s) : 0, 1206628
Total [candidate] (9.135 s) : 0, 9135345
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.093 s -
Agent iast 1.209 s 116.13 ms (10.6%)
Agent iast_HARDCODED_SECRET_DISABLED 1.215 s 122.299 ms (11.2%)
Agent iast_TELEMETRY_OFF 1.21 s 116.835 ms (10.7%)
Total tracing 8.596 s -
Total iast 9.156 s 559.341 ms (6.5%)
Total iast_HARDCODED_SECRET_DISABLED 9.093 s 497.036 ms (5.8%)
Total iast_TELEMETRY_OFF 9.114 s 517.28 ms (6.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.086 s -
Agent iast 1.207 s 121.606 ms (11.2%)
Agent iast_HARDCODED_SECRET_DISABLED 1.218 s 131.938 ms (12.2%)
Agent iast_TELEMETRY_OFF 1.207 s 121.04 ms (11.1%)
Total tracing 8.567 s -
Total iast 9.141 s 574.601 ms (6.7%)
Total iast_HARDCODED_SECRET_DISABLED 9.121 s 554.336 ms (6.5%)
Total iast_TELEMETRY_OFF 9.135 s 568.613 ms (6.6%)
gantt
    title insecure-bank - break down per module: candidate=1.43.0-SNAPSHOT~8da33a7b92, baseline=1.43.0-SNAPSHOT~8e1ab2bcd8

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (696.128 ms) : 0, 696128
BytebuddyAgent [candidate] (690.269 ms) : 0, 690269
GlobalTracer [baseline] (319.13 ms) : 0, 319130
GlobalTracer [candidate] (317.124 ms) : 0, 317124
AppSec [baseline] (54.532 ms) : 0, 54532
AppSec [candidate] (54.367 ms) : 0, 54367
Remote Config [baseline] (680.892 µs) : 0, 681
Remote Config [candidate] (684.206 µs) : 0, 684
Telemetry [baseline] (8.492 ms) : 0, 8492
Telemetry [candidate] (9.334 ms) : 0, 9334
section iast
BytebuddyAgent [baseline] (803.988 ms) : 0, 803988
BytebuddyAgent [candidate] (802.491 ms) : 0, 802491
GlobalTracer [baseline] (304.825 ms) : 0, 304825
GlobalTracer [candidate] (304.658 ms) : 0, 304658
AppSec [baseline] (57.562 ms) : 0, 57562
AppSec [candidate] (57.559 ms) : 0, 57559
IAST [baseline] (20.658 ms) : 0, 20658
IAST [candidate] (20.62 ms) : 0, 20620
Remote Config [baseline] (621.107 µs) : 0, 621
Remote Config [candidate] (617.318 µs) : 0, 617
Telemetry [baseline] (7.551 ms) : 0, 7551
Telemetry [candidate] (7.497 ms) : 0, 7497
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (808.456 ms) : 0, 808456
BytebuddyAgent [candidate] (809.532 ms) : 0, 809532
GlobalTracer [baseline] (306.378 ms) : 0, 306378
GlobalTracer [candidate] (306.904 ms) : 0, 306904
AppSec [baseline] (56.898 ms) : 0, 56898
AppSec [candidate] (57.52 ms) : 0, 57520
IAST [baseline] (21.429 ms) : 0, 21429
IAST [candidate] (21.5 ms) : 0, 21500
Remote Config [baseline] (610.263 µs) : 0, 610
Remote Config [candidate] (629.74 µs) : 0, 630
Telemetry [baseline] (7.542 ms) : 0, 7542
Telemetry [candidate] (7.531 ms) : 0, 7531
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (803.068 ms) : 0, 803068
BytebuddyAgent [candidate] (801.53 ms) : 0, 801530
GlobalTracer [baseline] (306.182 ms) : 0, 306182
GlobalTracer [candidate] (305.115 ms) : 0, 305115
AppSec [baseline] (57.4 ms) : 0, 57400
AppSec [candidate] (57.794 ms) : 0, 57794
IAST [baseline] (21.149 ms) : 0, 21149
IAST [candidate] (20.323 ms) : 0, 20323
Remote Config [baseline] (607.782 µs) : 0, 608
Remote Config [candidate] (615.524 µs) : 0, 616
Telemetry [baseline] (7.473 ms) : 0, 7473
Telemetry [candidate] (7.452 ms) : 0, 7452
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.43.0-SNAPSHOT~8da33a7b92, baseline=1.43.0-SNAPSHOT~8e1ab2bcd8

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.088 s) : 0, 1088373
Total [baseline] (10.379 s) : 0, 10378602
Agent [candidate] (1.089 s) : 0, 1088516
Total [candidate] (10.428 s) : 0, 10427775
section appsec
Agent [baseline] (1.215 s) : 0, 1215472
Total [baseline] (10.621 s) : 0, 10620689
Agent [candidate] (1.217 s) : 0, 1216686
Total [candidate] (10.67 s) : 0, 10670099
section iast
Agent [baseline] (1.216 s) : 0, 1216439
Total [baseline] (10.931 s) : 0, 10930802
Agent [candidate] (1.213 s) : 0, 1212838
Total [candidate] (10.9 s) : 0, 10900245
section profiling
Agent [baseline] (1.281 s) : 0, 1281243
Total [baseline] (10.759 s) : 0, 10759198
Agent [candidate] (1.284 s) : 0, 1284265
Total [candidate] (10.742 s) : 0, 10741992
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.088 s -
Agent appsec 1.215 s 127.099 ms (11.7%)
Agent iast 1.216 s 128.066 ms (11.8%)
Agent profiling 1.281 s 192.87 ms (17.7%)
Total tracing 10.379 s -
Total appsec 10.621 s 242.087 ms (2.3%)
Total iast 10.931 s 552.2 ms (5.3%)
Total profiling 10.759 s 380.596 ms (3.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.089 s -
Agent appsec 1.217 s 128.17 ms (11.8%)
Agent iast 1.213 s 124.322 ms (11.4%)
Agent profiling 1.284 s 195.749 ms (18.0%)
Total tracing 10.428 s -
Total appsec 10.67 s 242.323 ms (2.3%)
Total iast 10.9 s 472.469 ms (4.5%)
Total profiling 10.742 s 314.217 ms (3.0%)
gantt
    title petclinic - break down per module: candidate=1.43.0-SNAPSHOT~8da33a7b92, baseline=1.43.0-SNAPSHOT~8e1ab2bcd8

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (692.583 ms) : 0, 692583
BytebuddyAgent [candidate] (689.763 ms) : 0, 689763
GlobalTracer [baseline] (316.132 ms) : 0, 316132
GlobalTracer [candidate] (317.126 ms) : 0, 317126
AppSec [baseline] (54.504 ms) : 0, 54504
AppSec [candidate] (54.458 ms) : 0, 54458
Remote Config [baseline] (672.659 µs) : 0, 673
Remote Config [candidate] (669.671 µs) : 0, 670
Telemetry [baseline] (10.653 ms) : 0, 10653
Telemetry [candidate] (12.715 ms) : 0, 12715
section appsec
BytebuddyAgent [baseline] (704.325 ms) : 0, 704325
BytebuddyAgent [candidate] (705.215 ms) : 0, 705215
GlobalTracer [baseline] (313.005 ms) : 0, 313005
GlobalTracer [candidate] (313.595 ms) : 0, 313595
AppSec [baseline] (165.913 ms) : 0, 165913
AppSec [candidate] (165.969 ms) : 0, 165969
Remote Config [baseline] (639.433 µs) : 0, 639
Remote Config [candidate] (638.948 µs) : 0, 639
Telemetry [baseline] (7.801 ms) : 0, 7801
Telemetry [candidate] (8.192 ms) : 0, 8192
IAST [baseline] (20.139 ms) : 0, 20139
IAST [candidate] (18.713 ms) : 0, 18713
section iast
BytebuddyAgent [baseline] (809.512 ms) : 0, 809512
BytebuddyAgent [candidate] (806.307 ms) : 0, 806307
GlobalTracer [baseline] (305.793 ms) : 0, 305793
GlobalTracer [candidate] (305.836 ms) : 0, 305836
AppSec [baseline] (57.231 ms) : 0, 57231
AppSec [candidate] (57.857 ms) : 0, 57857
Remote Config [baseline] (634.098 µs) : 0, 634
Remote Config [candidate] (623.439 µs) : 0, 623
Telemetry [baseline] (7.563 ms) : 0, 7563
Telemetry [candidate] (7.54 ms) : 0, 7540
IAST [baseline] (21.836 ms) : 0, 21836
IAST [candidate] (20.888 ms) : 0, 20888
section profiling
BytebuddyAgent [baseline] (683.115 ms) : 0, 683115
BytebuddyAgent [candidate] (684.106 ms) : 0, 684106
GlobalTracer [baseline] (398.854 ms) : 0, 398854
GlobalTracer [candidate] (399.48 ms) : 0, 399480
AppSec [baseline] (54.788 ms) : 0, 54788
AppSec [candidate] (55.07 ms) : 0, 55070
Remote Config [baseline] (680.004 µs) : 0, 680
Remote Config [candidate] (688.565 µs) : 0, 689
Telemetry [baseline] (11.506 ms) : 0, 11506
Telemetry [candidate] (12.827 ms) : 0, 12827
ProfilingAgent [baseline] (93.262 ms) : 0, 93262
ProfilingAgent [candidate] (92.959 ms) : 0, 92959
Profiling [baseline] (93.285 ms) : 0, 93285
Profiling [candidate] (92.982 ms) : 0, 92982
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-11-07T09:54:39 2024-11-07T10:01:33
git_branch master andrea.marziali/netty-cancel
git_commit_date 1730965224 1730972617
git_commit_sha 8e1ab2b 8da33a7
release_version 1.43.0-SNAPSHOT~8e1ab2bcd8 1.43.0-SNAPSHOT~8da33a7b92
start_time 2024-11-07T09:54:25 2024-11-07T10:01:20
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1730974043 1730974043
ci_job_id 698594741 698594741
ci_pipeline_id 48430540 48430540
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.43.0-SNAPSHOT~8da33a7b92, baseline=1.43.0-SNAPSHOT~8e1ab2bcd8
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.333 ms) : 1313, 1354
.   : milestone, 1333,
appsec (1.722 ms) : 1697, 1747
.   : milestone, 1722,
appsec_no_iast (1.732 ms) : 1708, 1755
.   : milestone, 1732,
iast (1.474 ms) : 1452, 1496
.   : milestone, 1474,
profiling (1.527 ms) : 1502, 1551
.   : milestone, 1527,
tracing (1.467 ms) : 1442, 1492
.   : milestone, 1467,
section candidate
no_agent (1.341 ms) : 1321, 1360
.   : milestone, 1341,
appsec (1.709 ms) : 1685, 1733
.   : milestone, 1709,
appsec_no_iast (1.73 ms) : 1706, 1755
.   : milestone, 1730,
iast (1.479 ms) : 1457, 1501
.   : milestone, 1479,
profiling (1.515 ms) : 1491, 1539
.   : milestone, 1515,
tracing (1.474 ms) : 1450, 1499
.   : milestone, 1474,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.333 ms [1.313 ms, 1.354 ms] -
appsec 1.722 ms [1.697 ms, 1.747 ms] 388.398 µs (29.1%)
appsec_no_iast 1.732 ms [1.708 ms, 1.755 ms] 398.361 µs (29.9%)
iast 1.474 ms [1.452 ms, 1.496 ms] 140.448 µs (10.5%)
profiling 1.527 ms [1.502 ms, 1.551 ms] 193.31 µs (14.5%)
tracing 1.467 ms [1.442 ms, 1.492 ms] 133.788 µs (10.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.341 ms [1.321 ms, 1.36 ms] -
appsec 1.709 ms [1.685 ms, 1.733 ms] 367.981 µs (27.4%)
appsec_no_iast 1.73 ms [1.706 ms, 1.755 ms] 389.467 µs (29.0%)
iast 1.479 ms [1.457 ms, 1.501 ms] 137.757 µs (10.3%)
profiling 1.515 ms [1.491 ms, 1.539 ms] 173.89 µs (13.0%)
tracing 1.474 ms [1.45 ms, 1.499 ms] 133.465 µs (10.0%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~8da33a7b92, baseline=1.43.0-SNAPSHOT~8e1ab2bcd8
    dateFormat X
    axisFormat %s
section baseline
no_agent (377.762 µs) : 358, 398
.   : milestone, 378,
iast (489.845 µs) : 468, 511
.   : milestone, 490,
iast_FULL (647.678 µs) : 626, 669
.   : milestone, 648,
iast_GLOBAL (515.039 µs) : 493, 537
.   : milestone, 515,
iast_HARDCODED_SECRET_DISABLED (485.095 µs) : 464, 506
.   : milestone, 485,
iast_INACTIVE (446.402 µs) : 426, 467
.   : milestone, 446,
iast_TELEMETRY_OFF (475.482 µs) : 454, 497
.   : milestone, 475,
tracing (447.451 µs) : 426, 469
.   : milestone, 447,
section candidate
no_agent (376.107 µs) : 356, 396
.   : milestone, 376,
iast (486.554 µs) : 465, 508
.   : milestone, 487,
iast_FULL (647.698 µs) : 625, 671
.   : milestone, 648,
iast_GLOBAL (510.758 µs) : 490, 532
.   : milestone, 511,
iast_HARDCODED_SECRET_DISABLED (484.713 µs) : 463, 506
.   : milestone, 485,
iast_INACTIVE (447.588 µs) : 426, 469
.   : milestone, 448,
iast_TELEMETRY_OFF (475.49 µs) : 455, 496
.   : milestone, 475,
tracing (446.179 µs) : 425, 468
.   : milestone, 446,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 377.762 µs [357.663 µs, 397.862 µs] -
iast 489.845 µs [468.363 µs, 511.327 µs] 112.082 µs (29.7%)
iast_FULL 647.678 µs [626.427 µs, 668.929 µs] 269.916 µs (71.5%)
iast_GLOBAL 515.039 µs [492.713 µs, 537.366 µs] 137.277 µs (36.3%)
iast_HARDCODED_SECRET_DISABLED 485.095 µs [463.724 µs, 506.466 µs] 107.333 µs (28.4%)
iast_INACTIVE 446.402 µs [425.96 µs, 466.843 µs] 68.639 µs (18.2%)
iast_TELEMETRY_OFF 475.482 µs [454.22 µs, 496.744 µs] 97.719 µs (25.9%)
tracing 447.451 µs [426.324 µs, 468.578 µs] 69.689 µs (18.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 376.107 µs [356.007 µs, 396.208 µs] -
iast 486.554 µs [465.314 µs, 507.794 µs] 110.447 µs (29.4%)
iast_FULL 647.698 µs [624.789 µs, 670.607 µs] 271.591 µs (72.2%)
iast_GLOBAL 510.758 µs [489.588 µs, 531.928 µs] 134.651 µs (35.8%)
iast_HARDCODED_SECRET_DISABLED 484.713 µs [463.364 µs, 506.062 µs] 108.605 µs (28.9%)
iast_INACTIVE 447.588 µs [426.103 µs, 469.072 µs] 71.481 µs (19.0%)
iast_TELEMETRY_OFF 475.49 µs [454.565 µs, 496.415 µs] 99.383 µs (26.4%)
tracing 446.179 µs [424.718 µs, 467.64 µs] 70.071 µs (18.6%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/netty-cancel
git_commit_date 1730965224 1730972617
git_commit_sha 8e1ab2b 8da33a7
release_version 1.43.0-SNAPSHOT~8e1ab2bcd8 1.43.0-SNAPSHOT~8da33a7b92
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1730974575 1730974575
ci_job_id 698594742 698594742
ci_pipeline_id 48430540 48430540
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 biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~8da33a7b92, baseline=1.43.0-SNAPSHOT~8e1ab2bcd8
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.758 s) : 15758000, 15758000
.   : milestone, 15758000,
appsec (15.155 s) : 15155000, 15155000
.   : milestone, 15155000,
iast (19.113 s) : 19113000, 19113000
.   : milestone, 19113000,
iast_GLOBAL (18.198 s) : 18198000, 18198000
.   : milestone, 18198000,
profiling (14.957 s) : 14957000, 14957000
.   : milestone, 14957000,
tracing (14.973 s) : 14973000, 14973000
.   : milestone, 14973000,
section candidate
no_agent (15.711 s) : 15711000, 15711000
.   : milestone, 15711000,
appsec (15.121 s) : 15121000, 15121000
.   : milestone, 15121000,
iast (18.196 s) : 18196000, 18196000
.   : milestone, 18196000,
iast_GLOBAL (18.315 s) : 18315000, 18315000
.   : milestone, 18315000,
profiling (15.836 s) : 15836000, 15836000
.   : milestone, 15836000,
tracing (15.285 s) : 15285000, 15285000
.   : milestone, 15285000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.758 s [15.758 s, 15.758 s] -
appsec 15.155 s [15.155 s, 15.155 s] -603.0 ms (-3.8%)
iast 19.113 s [19.113 s, 19.113 s] 3.355 s (21.3%)
iast_GLOBAL 18.198 s [18.198 s, 18.198 s] 2.44 s (15.5%)
profiling 14.957 s [14.957 s, 14.957 s] -801.0 ms (-5.1%)
tracing 14.973 s [14.973 s, 14.973 s] -785.0 ms (-5.0%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.711 s [15.711 s, 15.711 s] -
appsec 15.121 s [15.121 s, 15.121 s] -590.0 ms (-3.8%)
iast 18.196 s [18.196 s, 18.196 s] 2.485 s (15.8%)
iast_GLOBAL 18.315 s [18.315 s, 18.315 s] 2.604 s (16.6%)
profiling 15.836 s [15.836 s, 15.836 s] 125.0 ms (0.8%)
tracing 15.285 s [15.285 s, 15.285 s] -426.0 ms (-2.7%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~8da33a7b92, baseline=1.43.0-SNAPSHOT~8e1ab2bcd8
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.463 ms) : 1452, 1475
.   : milestone, 1463,
appsec (2.343 ms) : 2302, 2385
.   : milestone, 2343,
iast (2.083 ms) : 2031, 2136
.   : milestone, 2083,
iast_GLOBAL (2.123 ms) : 2070, 2176
.   : milestone, 2123,
profiling (1.946 ms) : 1904, 1988
.   : milestone, 1946,
tracing (1.919 ms) : 1879, 1959
.   : milestone, 1919,
section candidate
no_agent (1.466 ms) : 1455, 1478
.   : milestone, 1466,
appsec (2.327 ms) : 2286, 2368
.   : milestone, 2327,
iast (2.066 ms) : 2015, 2118
.   : milestone, 2066,
iast_GLOBAL (2.131 ms) : 2079, 2184
.   : milestone, 2131,
profiling (1.937 ms) : 1896, 1978
.   : milestone, 1937,
tracing (1.91 ms) : 1870, 1950
.   : milestone, 1910,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.463 ms [1.452 ms, 1.475 ms] -
appsec 2.343 ms [2.302 ms, 2.385 ms] 880.088 µs (60.1%)
iast 2.083 ms [2.031 ms, 2.136 ms] 619.832 µs (42.4%)
iast_GLOBAL 2.123 ms [2.07 ms, 2.176 ms] 659.427 µs (45.1%)
profiling 1.946 ms [1.904 ms, 1.988 ms] 482.291 µs (33.0%)
tracing 1.919 ms [1.879 ms, 1.959 ms] 455.973 µs (31.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.466 ms [1.455 ms, 1.478 ms] -
appsec 2.327 ms [2.286 ms, 2.368 ms] 860.895 µs (58.7%)
iast 2.066 ms [2.015 ms, 2.118 ms] 599.837 µs (40.9%)
iast_GLOBAL 2.131 ms [2.079 ms, 2.184 ms] 664.924 µs (45.3%)
profiling 1.937 ms [1.896 ms, 1.978 ms] 470.942 µs (32.1%)
tracing 1.91 ms [1.87 ms, 1.95 ms] 443.726 µs (30.3%)

Copy link
Contributor

@ygree ygree left a comment

Choose a reason for hiding this comment

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

Looks good, but I'd appreciate some clarification on a couple of questions I have in the comments.

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
final AgentSpan span = ctx.channel().attr(SPAN_ATTRIBUTE_KEY).getAndRemove();
if (span != null && span.phasedFinish()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

So we finish it without publishing it, to publish it immediately afterwards. What's the trick?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

phasedFinish returns true only if the span is not already finished. So we can publish. it's a trick to avoid finishing twice

@amarziali amarziali requested a review from ygree November 6, 2024 18:27
@amarziali amarziali enabled auto-merge (squash) November 7, 2024 11:27
Copy link
Contributor

@ygree ygree left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@amarziali amarziali merged commit 9e8d0dc into master Nov 8, 2024
98 of 100 checks passed
@amarziali amarziali deleted the andrea.marziali/netty-cancel branch November 8, 2024 17:05
@github-actions github-actions bot added this to the 1.43.0 milestone Nov 8, 2024
vandonr pushed a commit that referenced this pull request Nov 13, 2024
* Finish netty span when request is cancelled

* Propagate channelInactive to next handler
vandonr added a commit that referenced this pull request Nov 13, 2024
* Finish netty span when request is cancelled (#7900)

* Finish netty span when request is cancelled

* Propagate channelInactive to next handler

* Support testing of latest quartz versions (#7948)

---------

Co-authored-by: Andrea Marziali <[email protected]>
PerfectSlayer pushed a commit that referenced this pull request Nov 15, 2024
* Finish netty span when request is cancelled

* Propagate channelInactive to next handler

(cherry picked from commit 9e8d0dc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: netty Netty instrumentation type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants