Skip to content

Conversation

@bouwkast
Copy link
Collaborator

Summary of changes

Fixes a NullReferenceException in IpcTcpProcessMessageIntegration.

Reason for change

Previously the code was just doing this: tracer.InternalActiveScope is var scope

And then we were calling scope.Span.Context but the Span property can be null.

Implementation details

Swapped to the property pattern { } which should address it.

Test coverage

I didn't update any tests

Other details

@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8023) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration68.16 ± (68.18 - 68.39) ms68.38 ± (68.32 - 68.54) ms+0.3%✅⬆️
.NET Framework 4.8 - Bailout
duration72.18 ± (72.02 - 72.30) ms72.10 ± (72.04 - 72.29) ms-0.1%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1004.61 ± (1008.90 - 1017.71) ms1006.73 ± (1010.98 - 1018.94) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms21.97 ± (21.93 - 22.01) ms22.01 ± (21.97 - 22.04) ms+0.2%✅⬆️
process.time_to_main_ms78.42 ± (78.26 - 78.57) ms78.71 ± (78.54 - 78.87) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.90 - 10.91) MB10.90 ± (10.90 - 10.91) MB-0.0%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.92 ± (21.90 - 21.94) ms21.95 ± (21.92 - 21.97) ms+0.1%✅⬆️
process.time_to_main_ms79.74 ± (79.65 - 79.84) ms79.75 ± (79.66 - 79.85) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.94 - 10.95) MB10.95 ± (10.94 - 10.95) MB+0.0%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms241.58 ± (237.45 - 245.71) ms243.99 ± (239.84 - 248.13) ms+1.0%✅⬆️
process.time_to_main_ms469.82 ± (469.43 - 470.20) ms470.70 ± (470.14 - 471.26) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.14 ± (48.12 - 48.16) MB48.23 ± (48.21 - 48.26) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 6 - Baseline
process.internal_duration_ms20.61 ± (20.58 - 20.64) ms20.73 ± (20.69 - 20.76) ms+0.6%✅⬆️
process.time_to_main_ms67.90 ± (67.78 - 68.02) ms68.24 ± (68.13 - 68.36) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.61) MB10.63 ± (10.63 - 10.63) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.52 ± (20.48 - 20.55) ms20.89 ± (20.80 - 20.97) ms+1.8%✅⬆️
process.time_to_main_ms68.72 ± (68.66 - 68.78) ms69.85 ± (69.56 - 70.14) ms+1.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.66 - 10.67) MB10.73 ± (10.73 - 10.74) MB+0.6%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms243.74 ± (241.62 - 245.86) ms249.09 ± (247.89 - 250.29) ms+2.2%✅⬆️
process.time_to_main_ms439.37 ± (438.95 - 439.79) ms440.66 ± (440.16 - 441.16) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.69 ± (48.66 - 48.72) MB48.63 ± (48.59 - 48.66) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms18.86 ± (18.83 - 18.89) ms18.79 ± (18.76 - 18.82) ms-0.4%
process.time_to_main_ms66.96 ± (66.86 - 67.07) ms66.93 ± (66.83 - 67.04) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.66 - 7.68) MB7.69 ± (7.68 - 7.70) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.87 ± (18.84 - 18.89) ms18.96 ± (18.94 - 18.99) ms+0.5%✅⬆️
process.time_to_main_ms68.14 ± (68.09 - 68.20) ms68.70 ± (68.59 - 68.81) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.72 - 7.74) MB7.73 ± (7.73 - 7.74) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms179.43 ± (178.40 - 180.47) ms179.94 ± (179.02 - 180.85) ms+0.3%✅⬆️
process.time_to_main_ms426.67 ± (426.07 - 427.28) ms427.68 ± (426.80 - 428.55) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.33 ± (36.30 - 36.36) MB36.40 ± (36.37 - 36.44) MB+0.2%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.0%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.33 ± (193.49 - 194.38) ms192.95 ± (192.75 - 193.46) ms-0.2%
.NET Framework 4.8 - Bailout
duration196.51 ± (196.65 - 197.38) ms196.92 ± (196.73 - 197.21) ms+0.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1105.95 ± (1108.43 - 1116.17) ms1116.28 ± (1118.19 - 1126.85) ms+0.9%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms187.65 ± (187.23 - 188.07) ms188.12 ± (187.78 - 188.47) ms+0.3%✅⬆️
process.time_to_main_ms80.43 ± (80.23 - 80.62) ms80.83 ± (80.64 - 81.01) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.07 ± (16.04 - 16.10) MB16.20 ± (16.17 - 16.22) MB+0.8%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms187.09 ± (186.83 - 187.35) ms187.67 ± (187.31 - 188.04) ms+0.3%✅⬆️
process.time_to_main_ms81.80 ± (81.68 - 81.93) ms82.48 ± (82.31 - 82.66) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.17 ± (16.14 - 16.19) MB16.16 ± (16.14 - 16.18) MB-0.0%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.0%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms423.39 ± (420.21 - 426.57) ms423.55 ± (420.03 - 427.07) ms+0.0%✅⬆️
process.time_to_main_ms472.31 ± (471.64 - 472.97) ms473.95 ± (473.38 - 474.52) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.81 ± (58.70 - 58.92) MB58.73 ± (58.60 - 58.86) MB-0.1%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 30)-0.0%
.NET 6 - Baseline
process.internal_duration_ms191.89 ± (191.51 - 192.28) ms192.07 ± (191.74 - 192.40) ms+0.1%✅⬆️
process.time_to_main_ms69.81 ± (69.67 - 69.95) ms70.27 ± (70.08 - 70.46) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.28 ± (16.18 - 16.37) MB16.23 ± (16.13 - 16.34) MB-0.3%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.02 ± (190.79 - 191.25) ms191.54 ± (191.24 - 191.83) ms+0.3%✅⬆️
process.time_to_main_ms70.83 ± (70.72 - 70.93) ms70.86 ± (70.76 - 70.96) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.22 ± (16.08 - 16.35) MB16.13 ± (15.98 - 16.28) MB-0.5%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.9%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms455.89 ± (454.05 - 457.74) ms456.78 ± (454.46 - 459.11) ms+0.2%✅⬆️
process.time_to_main_ms444.94 ± (444.42 - 445.46) ms447.92 ± (447.26 - 448.59) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.42 ± (58.30 - 58.54) MB58.16 ± (58.04 - 58.28) MB-0.4%
runtime.dotnet.threads.count29 ± (29 - 30)30 ± (29 - 30)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.41 ± (190.01 - 190.81) ms196.26 ± (195.67 - 196.86) ms+3.1%✅⬆️
process.time_to_main_ms69.42 ± (69.24 - 69.59) ms71.50 ± (71.25 - 71.76) ms+3.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.75 - 11.81) MB11.71 ± (11.69 - 11.73) MB-0.6%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.3%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms189.67 ± (189.39 - 189.96) ms193.07 ± (192.59 - 193.55) ms+1.8%✅⬆️
process.time_to_main_ms70.53 ± (70.39 - 70.67) ms71.40 ± (71.22 - 71.58) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.81 ± (11.78 - 11.84) MB11.79 ± (11.77 - 11.81) MB-0.1%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.4%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms362.18 ± (360.73 - 363.63) ms369.17 ± (367.78 - 370.57) ms+1.9%✅⬆️
process.time_to_main_ms428.11 ± (427.57 - 428.66) ms433.88 ± (433.18 - 434.59) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.95 ± (47.92 - 47.98) MB48.04 ± (48.01 - 48.07) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.1%✅⬆️
Comparison explanation

Execution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8023) - mean (68ms)  : 67, 70
    master - mean (68ms)  : 67, 70

    section Bailout
    This PR (8023) - mean (72ms)  : 71, 73
    master - mean (72ms)  : 71, 74

    section CallTarget+Inlining+NGEN
    This PR (8023) - mean (1,015ms)  : 957, 1073
    master - mean (1,013ms)  : 948, 1078

Loading
FakeDbCommand (.NET Core 3.1)
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8023) - mean (106ms)  : 104, 108
    master - mean (105ms)  : 103, 108

    section Bailout
    This PR (8023) - mean (107ms)  : 105, 108
    master - mean (107ms)  : 105, 108

    section CallTarget+Inlining+NGEN
    This PR (8023) - mean (738ms)  : 668, 808
    master - mean (735ms)  : 667, 804

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8023) - mean (94ms)  : 92, 96
    master - mean (93ms)  : 91, 95

    section Bailout
    This PR (8023) - mean (96ms)  : 88, 104
    master - mean (94ms)  : 93, 95

    section CallTarget+Inlining+NGEN
    This PR (8023) - mean (713ms)  : 685, 742
    master - mean (708ms)  : 671, 745

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8023) - mean (92ms)  : 90, 94
    master - mean (92ms)  : 90, 94

    section Bailout
    This PR (8023) - mean (94ms)  : 92, 95
    master - mean (93ms)  : 92, 94

    section CallTarget+Inlining+NGEN
    This PR (8023) - mean (636ms)  : 619, 653
    master - mean (634ms)  : 617, 650

Loading
HttpMessageHandler (.NET Framework 4.8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8023) - mean (193ms)  : 190, 197
    master - mean (194ms)  : 190, 198

    section Bailout
    This PR (8023) - mean (197ms)  : 195, 199
    master - mean (197ms)  : 193, 201

    section CallTarget+Inlining+NGEN
    This PR (8023) - mean (1,123ms)  : 1064, 1181
    master - mean (1,112ms)  : 1054, 1170

Loading
HttpMessageHandler (.NET Core 3.1)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8023) - mean (277ms)  : 273, 282
    master - mean (276ms)  : 272, 281

    section Bailout
    This PR (8023) - mean (278ms)  : 273, 282
    master - mean (277ms)  : 274, 280

    section CallTarget+Inlining+NGEN
    This PR (8023) - mean (928ms)  : 881, 975
    master - mean (925ms)  : 883, 967

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8023) - mean (270ms)  : 266, 275
    master - mean (270ms)  : 266, 274

    section Bailout
    This PR (8023) - mean (270ms)  : 267, 274
    master - mean (270ms)  : 267, 273

    section CallTarget+Inlining+NGEN
    This PR (8023) - mean (930ms)  : 877, 983
    master - mean (931ms)  : 898, 964

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8023) - mean (277ms)  : 265, 289
    master - mean (269ms)  : 264, 275

    section Bailout
    This PR (8023) - mean (274ms)  : 264, 285
    master - mean (270ms)  : 266, 274

    section CallTarget+Inlining+NGEN
    This PR (8023) - mean (835ms)  : 812, 859
    master - mean (822ms)  : 807, 837

Loading

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants