Skip to content

Fix timeout exception #7007

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
May 29, 2025
Merged

Conversation

NachoEchevarria
Copy link
Contributor

@NachoEchevarria NachoEchevarria commented May 26, 2025

Summary of changes

We are getting some timeout errors when downloading one of the libdwaf versions. It seems that one of the sync http calls can hang for minutes before returning anything.

This update improves the robustness of the DownloadWafVersion method by:

  • Introducing a short timeout (5 seconds) per HTTP request using CancellationTokenSource to prevent the method from hanging indefinitely.
  • Adding exponential backoff (2 * attempt seconds) between retries to reduce pressure on the remote server and increase the chances of success in case of transient network issues.
  • Replacing the previous retry loop with a bounded for loop using a maximum of 3 attempts.
  • Ensuring that appropriate exceptions are thrown if all attempts fail, to surface meaningful build errors.

These changes aim to prevent long build hangs and improve stability when downloading libddwaf from NuGet.

From https://dev.azure.com/datadoghq/a51c4863-3eb4-4c5d-878a-58b41a049e4e/_apis/build/builds/178278/logs/10816

2025-05-23T18:19:35.7804568Z Recursively copying from[36;1mD:\a\_work\1\s\shared\bin\monitoring-home\win-x64 to[36;1mD:\a\_work\1\s\tracer\test\Datadog.Trace.Security.Unit.Tests\bin\Release\net9.0\win-x64...
2025-05-23T18:19:35.7891568Z Copying file C:\Users\AzDevOps\AppData\Local\Temp\libddwaf.1.10.0\runtimes\win-x64\native\ddwaf.dll to[36;1mD:\a\_work\1\s\tracer\test\Datadog.Trace.Security.Unit.Tests\bin\Release\net9.0\win-x64\ddwaf-1.10.0.dll...
2025-05-23T18:21:15.7957028Z ##[error]Target "CopyNativeFilesForAppSecUnitTests" has thrown an exception
2025-05-23T18:21:15.8039566Z CopyNativeFilesForAppSecUnitTests has thrown an exception
2025-05-23T18:21:15.8040136Z System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
2025-05-23T18:21:15.8040401Z  ---> System.TimeoutException: The operation was canceled.
2025-05-23T18:21:15.8040732Z  ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
2025-05-23T18:21:15.8041136Z  ---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
2025-05-23T18:21:15.8041564Z  ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
2025-05-23T18:21:15.8041989Z[90m   --- End of inner exception stack trace ---
2025-05-23T18:21:15.8042445Z[90m   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
2025-05-23T18:21:15.8043042Z[90m   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
2025-05-23T18:21:15.8043378Z[90m   at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
2025-05-23T18:21:15.8043743Z[90m   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
2025-05-23T18:21:15.8044091Z[90m   at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken)
2025-05-23T18:21:15.8044452Z[90m   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
2025-05-23T18:21:15.8044754Z[90m   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
2025-05-23T18:21:15.8045042Z[90m   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
2025-05-23T18:21:15.8046002Z[90m   --- End of inner exception stack trace ---
2025-05-23T18:21:15.8046285Z[90m   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
2025-05-23T18:21:15.8046649Z[90m   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
2025-05-23T18:21:15.8046990Z[90m   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
2025-05-23T18:21:15.8047439Z[90m   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
2025-05-23T18:21:15.8047775Z[90m   --- End of inner exception stack trace ---
2025-05-23T18:21:15.8047969Z[90m   --- End of inner exception stack trace ---
2025-05-23T18:21:15.8048329Z[90m   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
2025-05-23T18:21:15.8048822Z[90m   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
2025-05-23T18:21:15.8049236Z[90m   at Build.DownloadWafVersion(String libddwafVersion, String uncompressFolderTarget) in D:\a\_work\1\s\tracer\build\_build\Build.Steps.cs:line 503
2025-05-23T18:21:15.8049572Z[90m   at Build.<get_CopyNativeFilesForAppSecUnitTests>b__470_1() in D:\a\_work\1\s\tracer\build\_build\Build.Steps.cs:line 651
2025-05-23T18:21:15.8049913Z[90m   at Nuke.Common.Execution.TargetDefinition.<>c__DisplayClass77_0.<Executes>b__0() in /_/source/Nuke.Common/Execution/TargetDefinition.cs:line 71
2025-05-23T18:21:15.8050249Z[90m   at Nuke.Common.Execution.BuildExecutor.<>c.<Execute>b__4_2(Action x) in /_/source/Nuke.Common/Execution/BuildExecutor.cs:line 112
2025-05-23T18:21:15.8050750Z[90m   at Nuke.Common.Utilities.Collections.EnumerableExtensions.ForEach[T](IEnumerable`1 enumerable, Action`1 action) in /_/source/Nuke.Common/Utilities/Collections/Enumerable.ForEach.cs:line 17
2025-05-23T18:21:15.8051947Z[90m   at Nuke.Common.Execution.BuildExecutor.Execute(NukeBuild build, ExecutableTarget target, IReadOnlyCollection`1 previouslyExecutedTargets, Boolean failureMode) in /_/source/Nuke.Common/Execution/BuildExecutor.cs:line 112
2025-05-23T18:21:15.8052789Z ##[endgroup]CopyNativeFilesForAppSecUnitTests

Reason for change

Implementation details

Test coverage

Other details

@github-actions github-actions bot added the area:builds project files, build scripts, pipelines, versioning, releases, packages label May 26, 2025
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented May 26, 2025

Datadog Report

Branch report: nacho/AvoidDownladingWAFTimeout
Commit report: 6a61664
Test service: dd-trace-dotnet

✅ 0 Failed, 249124 Passed, 2310 Skipped, 15h 5m 52.59s Total Time

@andrewlock
Copy link
Member

andrewlock commented May 26, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

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 shown 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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7007) - mean (68ms)  : 65, 71
     .   : milestone, 68,
    master - mean (68ms)  : 64, 73
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (7007) - mean (1,006ms)  : 984, 1029
     .   : milestone, 1006,
    master - mean (1,009ms)  : 983, 1035
     .   : milestone, 1009,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7007) - mean (102ms)  : 100, 104
     .   : milestone, 102,
    master - mean (103ms)  : 100, 106
     .   : milestone, 103,

    section CallTarget+Inlining+NGEN
    This PR (7007) - mean (691ms)  : 670, 712
     .   : milestone, 691,
    master - mean (695ms)  : 677, 714
     .   : milestone, 695,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7007) - mean (89ms)  : 87, 91
     .   : milestone, 89,
    master - mean (89ms)  : 87, 91
     .   : milestone, 89,

    section CallTarget+Inlining+NGEN
    This PR (7007) - mean (647ms)  : 627, 666
     .   : milestone, 647,
    master - mean (657ms)  : 639, 675
     .   : milestone, 657,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7007) - mean (189ms)  : 185, 194
     .   : milestone, 189,
    master - mean (189ms)  : 185, 193
     .   : milestone, 189,

    section CallTarget+Inlining+NGEN
    This PR (7007) - mean (1,111ms)  : 1079, 1144
     .   : milestone, 1111,
    master - mean (1,113ms)  : 1079, 1147
     .   : milestone, 1113,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7007) - mean (269ms)  : 265, 273
     .   : milestone, 269,
    master - mean (268ms)  : 265, 272
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (7007) - mean (875ms)  : 845, 906
     .   : milestone, 875,
    master - mean (882ms)  : 850, 913
     .   : milestone, 882,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7007) - mean (261ms)  : 257, 266
     .   : milestone, 261,
    master - mean (262ms)  : 258, 266
     .   : milestone, 262,

    section CallTarget+Inlining+NGEN
    This PR (7007) - mean (869ms)  : 835, 903
     .   : milestone, 869,
    master - mean (869ms)  : 841, 897
     .   : milestone, 869,

Loading

@pr-commenter
Copy link

pr-commenter bot commented May 26, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7007 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.138
  • 2 benchmarks have fewer allocations
  • 3 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.6μs 56.4ns 304ns 0 0 0 5.54 KB
master StartStopWithChild netcoreapp3.1 14.3μs 75.1ns 390ns 0 0 0 5.76 KB
master StartStopWithChild net472 21.8μs 120ns 679ns 0.912 0.228 0 6.17 KB
#7007 StartStopWithChild net6.0 10.7μs 57.1ns 313ns 0 0 0 5.55 KB
#7007 StartStopWithChild netcoreapp3.1 14μs 70.6ns 308ns 0 0 0 5.76 KB
#7007 StartStopWithChild net472 22.4μs 99.2ns 384ns 0.955 0.212 0 6.18 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 945μs 49.7ns 186ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 54.6ns 189ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.22ms 434ns 1.68μs 0 0 0 3.31 KB
#7007 WriteAndFlushEnrichedTraces net6.0 941μs 67.5ns 261ns 0 0 0 2.7 KB
#7007 WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 196ns 760ns 0 0 0 2.7 KB
#7007 WriteAndFlushEnrichedTraces net472 1.24ms 50.7ns 190ns 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 330μs 209ns 810ns 0 0 0 197.06 KB
master AllCycleSimpleBody netcoreapp3.1 491μs 2.29μs 8.86μs 0 0 0 204.77 KB
master AllCycleSimpleBody net472 440μs 162ns 628ns 35.7 2.23 0 236.37 KB
master AllCycleMoreComplexBody net6.0 340μs 1.7μs 7.8μs 0 0 0 200.56 KB
master AllCycleMoreComplexBody netcoreapp3.1 483μs 1.74μs 6.76μs 0 0 0 208.18 KB
master AllCycleMoreComplexBody net472 446μs 172ns 667ns 37.9 2.23 0 239.88 KB
master ObjectExtractorSimpleBody net6.0 322ns 1.66ns 7.43ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 395ns 1.91ns 7.64ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 302ns 0.0932ns 0.361ns 0.0441 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.35μs 1.59ns 6.18ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.71μs 28.5ns 110ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.78μs 1.52ns 5.28ns 0.575 0 0 3.8 KB
#7007 AllCycleSimpleBody net6.0 329μs 190ns 735ns 0 0 0 197.06 KB
#7007 AllCycleSimpleBody netcoreapp3.1 493μs 420ns 1.63μs 0 0 0 204.77 KB
#7007 AllCycleSimpleBody net472 436μs 158ns 610ns 36.6 2.16 0 236.35 KB
#7007 AllCycleMoreComplexBody net6.0 342μs 235ns 880ns 0 0 0 200.56 KB
#7007 AllCycleMoreComplexBody netcoreapp3.1 496μs 319ns 1.24μs 0 0 0 208.18 KB
#7007 AllCycleMoreComplexBody net472 451μs 539ns 2.09μs 37.9 2.23 0 239.88 KB
#7007 ObjectExtractorSimpleBody net6.0 311ns 1.67ns 8.84ns 0 0 0 280 B
#7007 ObjectExtractorSimpleBody netcoreapp3.1 412ns 2.13ns 10.2ns 0 0 0 272 B
#7007 ObjectExtractorSimpleBody net472 302ns 0.0429ns 0.166ns 0.0441 0 0 281 B
#7007 ObjectExtractorMoreComplexBody net6.0 6.38μs 3.79ns 14.7ns 0 0 0 3.78 KB
#7007 ObjectExtractorMoreComplexBody netcoreapp3.1 7.77μs 20.7ns 80.2ns 0 0 0 3.69 KB
#7007 ObjectExtractorMoreComplexBody net472 6.67μs 2.18ns 8.43ns 0.601 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
master EncodeArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master EncodeArgs net472 N/A N/A N/A NaN NaN NaN 0 b
master EncodeLegacyArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
master EncodeLegacyArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master EncodeLegacyArgs net472 N/A N/A N/A NaN NaN NaN 0 b
#7007 EncodeArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7007 EncodeArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7007 EncodeArgs net472 N/A N/A N/A NaN NaN NaN 0 b
#7007 EncodeLegacyArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7007 EncodeLegacyArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7007 EncodeLegacyArgs net472 N/A N/A N/A NaN NaN NaN 0 b
Benchmarks.Trace.Asm.AppSecWafBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmark netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmark net472 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmarkWithAttack net6.0 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmarkWithAttack net472 N/A N/A N/A NaN NaN NaN 0 b
#7007 RunWafRealisticBenchmark net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7007 RunWafRealisticBenchmark netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7007 RunWafRealisticBenchmark net472 N/A N/A N/A NaN NaN NaN 0 b
#7007 RunWafRealisticBenchmarkWithAttack net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7007 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7007 RunWafRealisticBenchmarkWithAttack net472 N/A N/A N/A NaN NaN NaN 0 b
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 60.4μs 17.9ns 64.7ns 0 0 0 14.53 KB
master SendRequest netcoreapp3.1 70.7μs 112ns 388ns 0 0 0 17.42 KB
master SendRequest net472 0.00853ns 0.0025ns 0.00969ns 0 0 0 0 b
#7007 SendRequest net6.0 60.4μs 65.9ns 287ns 0 0 0 14.53 KB
#7007 SendRequest netcoreapp3.1 70.8μs 60.3ns 217ns 0 0 0 17.42 KB
#7007 SendRequest net472 0.000558ns 0.000367ns 0.00142ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7007

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 1.138 779,161.84 684,664.29

More allocations ⚠️ in #7007

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.76 KB 42.04 KB 279 B 0.67%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 654μs 559ns 2.16μs 0 0 0 41.72 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 767μs 4.4μs 33.8μs 0 0 0 41.76 KB
master WriteAndFlushEnrichedTraces net472 853μs 2.52μs 9.07μs 8.33 0 0 56.08 KB
#7007 WriteAndFlushEnrichedTraces net6.0 631μs 492ns 2.15μs 0 0 0 41.59 KB
#7007 WriteAndFlushEnrichedTraces netcoreapp3.1 679μs 2.83μs 11μs 0 0 0 42.04 KB
#7007 WriteAndFlushEnrichedTraces net472 849μs 3.87μs 14μs 8.33 0 0 56.25 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 2μs 7.14ns 27.7ns 0 0 0 1.03 KB
master ExecuteNonQuery netcoreapp3.1 2.5μs 9.55ns 35.7ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.66μs 4.88ns 18.9ns 0.158 0.0131 0 995 B
#7007 ExecuteNonQuery net6.0 1.95μs 1.13ns 4.23ns 0 0 0 1.03 KB
#7007 ExecuteNonQuery netcoreapp3.1 2.45μs 10.2ns 36.7ns 0 0 0 1.02 KB
#7007 ExecuteNonQuery net472 2.68μs 6.61ns 25.6ns 0.146 0.0133 0 995 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.76μs 8.53ns 34.1ns 0 0 0 1.04 KB
master CallElasticsearch netcoreapp3.1 2.43μs 10.2ns 39.6ns 0 0 0 1.04 KB
master CallElasticsearch net472 3.44μs 2.68ns 10.4ns 0.154 0 0 1.05 KB
master CallElasticsearchAsync net6.0 1.82μs 6.71ns 26ns 0 0 0 1.02 KB
master CallElasticsearchAsync netcoreapp3.1 2.41μs 8.39ns 32.5ns 0 0 0 1.09 KB
master CallElasticsearchAsync net472 3.59μs 7.89ns 30.6ns 0.161 0 0 1.11 KB
#7007 CallElasticsearch net6.0 1.75μs 8.59ns 34.4ns 0 0 0 1.04 KB
#7007 CallElasticsearch netcoreapp3.1 2.35μs 8.69ns 33.6ns 0 0 0 1.04 KB
#7007 CallElasticsearch net472 3.48μs 0.976ns 3.52ns 0.156 0 0 1.05 KB
#7007 CallElasticsearchAsync net6.0 1.85μs 4.56ns 17.7ns 0 0 0 1.02 KB
#7007 CallElasticsearchAsync netcoreapp3.1 2.35μs 8.28ns 32.1ns 0 0 0 1.09 KB
#7007 CallElasticsearchAsync net472 3.64μs 4.81ns 18.6ns 0.165 0 0 1.11 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.8μs 8.78ns 37.2ns 0 0 0 960 B
master ExecuteAsync netcoreapp3.1 2.34μs 4.25ns 16.5ns 0 0 0 960 B
master ExecuteAsync net472 2.64μs 5.63ns 21.8ns 0.144 0 0 923 B
#7007 ExecuteAsync net6.0 1.85μs 9.1ns 35.2ns 0 0 0 960 B
#7007 ExecuteAsync netcoreapp3.1 2.35μs 10.7ns 41.4ns 0 0 0 960 B
#7007 ExecuteAsync net472 2.6μs 1.84ns 6.88ns 0.142 0 0 923 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 6.68μs 15.8ns 61.2ns 0 0 0 2.37 KB
master SendAsync netcoreapp3.1 8.9μs 23.1ns 89.4ns 0 0 0 2.9 KB
master SendAsync net472 12μs 6.96ns 26.9ns 0.478 0 0 3.19 KB
#7007 SendAsync net6.0 6.99μs 10.2ns 39.6ns 0 0 0 2.37 KB
#7007 SendAsync netcoreapp3.1 8.43μs 7.71ns 29.9ns 0 0 0 2.9 KB
#7007 SendAsync net472 12.1μs 10.1ns 39.2ns 0.482 0 0 3.19 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7007

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 45.53 KB 86.43 KB 40.9 KB 89.84%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 253.41 KB 281.21 KB 27.8 KB 10.97%

Fewer allocations 🎉 in #7007

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 278.88 KB 273.79 KB -5.09 KB -1.82%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 44.71 KB 43.1 KB -1.61 KB -3.60%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 45.1μs 265ns 2.4μs 0 0 0 44.71 KB
master StringConcatBenchmark netcoreapp3.1 54.2μs 685ns 6.72μs 0 0 0 45.53 KB
master StringConcatBenchmark net472 57.5μs 268ns 1.04μs 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 459μs 737ns 2.55μs 0 0 0 253.41 KB
master StringConcatAspectBenchmark netcoreapp3.1 542μs 2.29μs 8.25μs 0 0 0 278.88 KB
master StringConcatAspectBenchmark net472 404μs 1.61μs 6.04μs 0 0 0 278.53 KB
#7007 StringConcatBenchmark net6.0 44.3μs 203ns 759ns 0 0 0 43.1 KB
#7007 StringConcatBenchmark netcoreapp3.1 53.6μs 534ns 5.29μs 0 0 0 86.43 KB
#7007 StringConcatBenchmark net472 57.4μs 104ns 389ns 0 0 0 57.34 KB
#7007 StringConcatAspectBenchmark net6.0 508μs 1.64μs 5.68μs 0 0 0 281.21 KB
#7007 StringConcatAspectBenchmark netcoreapp3.1 515μs 2.31μs 8.64μs 0 0 0 273.79 KB
#7007 StringConcatAspectBenchmark net472 408μs 2.16μs 11.2μs 0 0 0 278.53 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.63μs 13.2ns 60.7ns 0 0 0 1.76 KB
master EnrichedLog netcoreapp3.1 3.41μs 12.5ns 48.3ns 0 0 0 1.76 KB
master EnrichedLog net472 3.9μs 5.17ns 19.3ns 0.253 0 0 1.69 KB
#7007 EnrichedLog net6.0 2.59μs 1.57ns 6.1ns 0 0 0 1.76 KB
#7007 EnrichedLog netcoreapp3.1 3.5μs 1.63ns 6.08ns 0 0 0 1.76 KB
#7007 EnrichedLog net472 3.94μs 3.69ns 14.3ns 0.255 0 0 1.69 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 124μs 42ns 145ns 0 0 0 4.37 KB
master EnrichedLog netcoreapp3.1 127μs 137ns 513ns 0 0 0 4.37 KB
master EnrichedLog net472 166μs 139ns 539ns 0 0 0 4.57 KB
#7007 EnrichedLog net6.0 123μs 78ns 292ns 0 0 0 4.37 KB
#7007 EnrichedLog netcoreapp3.1 129μs 267ns 1.03μs 0 0 0 4.37 KB
#7007 EnrichedLog net472 167μs 30.4ns 118ns 0 0 0 4.57 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 5.14μs 16.1ns 62.4ns 0 0 0 2.32 KB
master EnrichedLog netcoreapp3.1 6.87μs 16.4ns 63.5ns 0 0 0 2.32 KB
master EnrichedLog net472 7.38μs 5.66ns 21.9ns 0.336 0 0 2.14 KB
#7007 EnrichedLog net6.0 4.97μs 15.8ns 61.3ns 0 0 0 2.32 KB
#7007 EnrichedLog netcoreapp3.1 6.75μs 19.2ns 74.3ns 0 0 0 2.32 KB
#7007 EnrichedLog net472 7.7μs 6.22ns 24.1ns 0.307 0 0 2.14 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 2.02μs 10.2ns 44.6ns 0 0 0 1.21 KB
master SendReceive netcoreapp3.1 2.59μs 9.36ns 36.2ns 0 0 0 1.21 KB
master SendReceive net472 3.03μs 3.13ns 11.7ns 0.182 0 0 1.21 KB
#7007 SendReceive net6.0 1.99μs 9.09ns 34ns 0 0 0 1.21 KB
#7007 SendReceive netcoreapp3.1 2.6μs 11.6ns 45.1ns 0 0 0 1.21 KB
#7007 SendReceive net472 3.07μs 1.79ns 6.93ns 0.185 0 0 1.21 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.33μs 3.52ns 13.2ns 0 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 5.51μs 13.5ns 52.4ns 0 0 0 1.69 KB
master EnrichedLog net472 6.58μs 7.84ns 30.4ns 0.328 0 0 2.08 KB
#7007 EnrichedLog net6.0 4.12μs 18ns 67.3ns 0 0 0 1.64 KB
#7007 EnrichedLog netcoreapp3.1 5.63μs 10.8ns 42ns 0 0 0 1.69 KB
#7007 EnrichedLog net472 6.86μs 8.77ns 34ns 0.306 0 0 2.08 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 756ns 4.15ns 24.9ns 0 0 0 584 B
master StartFinishSpan netcoreapp3.1 933ns 4.48ns 17.9ns 0 0 0 584 B
master StartFinishSpan net472 937ns 0.124ns 0.448ns 0.0893 0 0 586 B
master StartFinishScope net6.0 904ns 1.66ns 6.43ns 0 0 0 704 B
master StartFinishScope netcoreapp3.1 1.18μs 6.38ns 36.1ns 0 0 0 704 B
master StartFinishScope net472 1.11μs 0.171ns 0.641ns 0.105 0 0 666 B
#7007 StartFinishSpan net6.0 738ns 3.59ns 15.2ns 0 0 0 584 B
#7007 StartFinishSpan netcoreapp3.1 949ns 4.38ns 17ns 0 0 0 584 B
#7007 StartFinishSpan net472 915ns 0.263ns 1.02ns 0.0916 0 0 586 B
#7007 StartFinishScope net6.0 894ns 4.33ns 16.8ns 0 0 0 704 B
#7007 StartFinishScope netcoreapp3.1 1.19μs 4.96ns 19.2ns 0 0 0 704 B
#7007 StartFinishScope net472 1.13μs 0.553ns 1.91ns 0.102 0 0 666 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.02μs 5.28ns 21.8ns 0 0 0 704 B
master RunOnMethodBegin netcoreapp3.1 1.34μs 6.86ns 32.2ns 0 0 0 704 B
master RunOnMethodBegin net472 1.34μs 1.15ns 4.46ns 0.1 0 0 666 B
#7007 RunOnMethodBegin net6.0 996ns 4.73ns 18.9ns 0 0 0 704 B
#7007 RunOnMethodBegin netcoreapp3.1 1.41μs 5.49ns 21.3ns 0 0 0 704 B
#7007 RunOnMethodBegin net472 1.36μs 1.04ns 4.01ns 0.102 0 0 666 B

@NachoEchevarria NachoEchevarria marked this pull request as ready for review May 27, 2025 08:56
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner May 27, 2025 08:56
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

Thank you!

@NachoEchevarria
Copy link
Contributor Author

Thanks for your reviews!

@NachoEchevarria NachoEchevarria merged commit 19ec960 into master May 29, 2025
126 of 127 checks passed
@NachoEchevarria NachoEchevarria deleted the nacho/AvoidDownladingWAFTimeout branch May 29, 2025 12:05
@github-actions github-actions bot added this to the vNext-v3 milestone May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:builds project files, build scripts, pipelines, versioning, releases, packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants