Skip to content

Replace DownloadPipelineArtifact by a pipeline step #7021

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 14 commits into from
May 29, 2025

Conversation

NachoEchevarria
Copy link
Contributor

@NachoEchevarria NachoEchevarria commented May 28, 2025

Summary of changes

There has been spoted a failure related to this task in installer_smoke_tests_arm64 in this pipeline due to timeout:

        - task: DownloadPipelineArtifact@2
          displayName: Download artifacts to smoke test directory
          inputs:
            artifact: $(linuxArtifacts)
            path: $(smokeTestAppDir)/artifacts

2025-05-23T12:21:16.3318668Z Downloaded 59.9 MB out of 66.8 MB (90%).
2025-05-23T12:21:19.0682015Z Downloaded 59.9 MB out of 66.8 MB (90%).
2025-05-23T12:21:19.7992375Z ##[error]The Operation will be canceled. The next steps may not contain expected logs.

While this task usually completes in around 10 seconds, this time, it failed after 45 mins. Seems like the error is not related to us but more to Azure. It's interesting that the artifact download succeeded for the other jobs of this stage.
Setting timeoutInMinutes and retryCountOnTaskFailure could help to prevent these issues, but this could potentially happen with any DownloadPipelineArtifact task, so this PR adds some default values for every DownloadPipelineArtifact used in the pipeline. These default values can optionally be overridden.

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 28, 2025
@NachoEchevarria NachoEchevarria requested a review from Copilot May 28, 2025 08:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces direct DownloadPipelineArtifact task invocations with a reusable pipeline step template, streamlining artifact download steps across the pipeline YAML files. Key changes include:

  • Converting multiple task invocations to use the new download-artifact.yml template.
  • Updating parameter passing for artifact download steps in various YAML files.
  • Introducing the download-artifact.yml template to centralize artifact download configuration.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
.azure-pipelines/steps/restore-working-directory.yml Replaces direct task usage with a templated artifact download step.
.azure-pipelines/steps/restore-working-directory-for-tests.yml Converts task usage for test artifacts to the new template (parameters incomplete).
.azure-pipelines/steps/download-samples.yml Updates sample artifact downloads to use the new template (inconsistent parameter usage).
.azure-pipelines/steps/download-artifact.yml Introduces the reusable template for artifact downloads.
Comments suppressed due to low confidence (2)

.azure-pipelines/steps/restore-working-directory-for-tests.yml:25

  • The template usage here only passes the displayName parameter, but the original task included artifact and path inputs. Please include the missing artifact and path parameters to ensure the step functions correctly.
displayName: Download universal home binaries

.azure-pipelines/steps/download-samples.yml:8

  • Since the download-artifact.yml template expects parameters (as seen in other files), please update the 'inputs:' block to 'parameters:' to ensure consistency and proper parameter binding.
inputs:

@pr-commenter
Copy link

pr-commenter bot commented May 28, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7021 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.123
  • 3 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 ✔️ More allocations ⚠️

More allocations ⚠️ in #7021

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.65 KB 5.77 KB 113 B 2.00%

Fewer allocations 🎉 in #7021

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.13 KB 6.09 KB -39 B -0.64%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.6μs 57.2ns 314ns 0 0 0 5.55 KB
master StartStopWithChild netcoreapp3.1 13.9μs 65ns 252ns 0 0 0 5.65 KB
master StartStopWithChild net472 22.2μs 124ns 784ns 0.98 0.436 0.109 6.13 KB
#7021 StartStopWithChild net6.0 10.7μs 59.9ns 374ns 0 0 0 5.55 KB
#7021 StartStopWithChild netcoreapp3.1 14.2μs 63ns 244ns 0 0 0 5.77 KB
#7021 StartStopWithChild net472 22.3μs 118ns 592ns 1.05 0.315 0.105 6.09 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 54.8ns 190ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 309ns 1.2μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.21ms 57ns 213ns 0 0 0 3.31 KB
#7021 WriteAndFlushEnrichedTraces net6.0 948μs 108ns 417ns 0 0 0 2.7 KB
#7021 WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 85.2ns 330ns 0 0 0 2.7 KB
#7021 WriteAndFlushEnrichedTraces net472 1.22ms 840ns 3.25μs 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 335μs 560ns 2.17μs 0 0 0 197.06 KB
master AllCycleSimpleBody netcoreapp3.1 476μs 768ns 2.97μs 0 0 0 204.77 KB
master AllCycleSimpleBody net472 456μs 126ns 455ns 35.7 2.23 0 236.37 KB
master AllCycleMoreComplexBody net6.0 336μs 1.69μs 7.54μs 0 0 0 200.56 KB
master AllCycleMoreComplexBody netcoreapp3.1 482μs 1.8μs 6.96μs 0 0 0 208.18 KB
master AllCycleMoreComplexBody net472 448μs 151ns 564ns 37.9 2.23 0 239.88 KB
master ObjectExtractorSimpleBody net6.0 310ns 0.0693ns 0.25ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 390ns 2.1ns 11.7ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 305ns 0.0261ns 0.0977ns 0.0441 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.3μs 8.14ns 31.5ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.75μs 1.15ns 4.13ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.76μs 7.92ns 30.7ns 0.576 0 0 3.8 KB
#7021 AllCycleSimpleBody net6.0 331μs 1.73μs 8.29μs 0 0 0 197.06 KB
#7021 AllCycleSimpleBody netcoreapp3.1 499μs 1.82μs 7.06μs 0 0 0 204.77 KB
#7021 AllCycleSimpleBody net472 440μs 106ns 383ns 36.6 2.16 0 236.35 KB
#7021 AllCycleMoreComplexBody net6.0 339μs 1.46μs 5.67μs 0 0 0 200.56 KB
#7021 AllCycleMoreComplexBody netcoreapp3.1 485μs 1.63μs 6.3μs 0 0 0 208.18 KB
#7021 AllCycleMoreComplexBody net472 447μs 112ns 433ns 37.9 2.23 0 239.88 KB
#7021 ObjectExtractorSimpleBody net6.0 321ns 1.65ns 8.27ns 0 0 0 280 B
#7021 ObjectExtractorSimpleBody netcoreapp3.1 395ns 0.163ns 0.633ns 0 0 0 272 B
#7021 ObjectExtractorSimpleBody net472 301ns 0.0111ns 0.0416ns 0.044 0 0 281 B
#7021 ObjectExtractorMoreComplexBody net6.0 6.26μs 28.5ns 110ns 0 0 0 3.78 KB
#7021 ObjectExtractorMoreComplexBody netcoreapp3.1 7.79μs 26.7ns 103ns 0 0 0 3.69 KB
#7021 ObjectExtractorMoreComplexBody net472 6.67μs 3.54ns 12.8ns 0.571 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
#7021 EncodeArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7021 EncodeArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7021 EncodeArgs net472 N/A N/A N/A NaN NaN NaN 0 b
#7021 EncodeLegacyArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7021 EncodeLegacyArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7021 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
#7021 RunWafRealisticBenchmark net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7021 RunWafRealisticBenchmark netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7021 RunWafRealisticBenchmark net472 N/A N/A N/A NaN NaN NaN 0 b
#7021 RunWafRealisticBenchmarkWithAttack net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7021 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7021 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 61.2μs 42.7ns 160ns 0 0 0 14.53 KB
master SendRequest netcoreapp3.1 70.6μs 117ns 407ns 0 0 0 17.42 KB
master SendRequest net472 0.0106ns 0.00294ns 0.0114ns 0 0 0 0 b
#7021 SendRequest net6.0 61.9μs 74.6ns 269ns 0 0 0 14.53 KB
#7021 SendRequest netcoreapp3.1 70.7μs 105ns 378ns 0 0 0 17.42 KB
#7021 SendRequest net472 0.00509ns 0.0017ns 0.00657ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #7021

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 1.123 723,992.86 644,616.52

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 682μs 1.28μs 4.95μs 0 0 0 41.78 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 723μs 2.03μs 7.33μs 0 0 0 41.97 KB
master WriteAndFlushEnrichedTraces net472 912μs 2.38μs 9.21μs 4.46 0 0 55.98 KB
#7021 WriteAndFlushEnrichedTraces net6.0 727μs 2.13μs 8.27μs 0 0 0 41.75 KB
#7021 WriteAndFlushEnrichedTraces netcoreapp3.1 644μs 690ns 2.49μs 0 0 0 42.09 KB
#7021 WriteAndFlushEnrichedTraces net472 965μs 4.26μs 16.5μs 4.81 0 0 55.95 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.03μs 1.22ns 4.74ns 0 0 0 1.03 KB
master ExecuteNonQuery netcoreapp3.1 2.49μs 4.13ns 16ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.71μs 4.4ns 16.5ns 0.147 0.0133 0 995 B
#7021 ExecuteNonQuery net6.0 1.96μs 3.76ns 14.6ns 0 0 0 1.03 KB
#7021 ExecuteNonQuery netcoreapp3.1 2.49μs 7.39ns 28.6ns 0 0 0 1.02 KB
#7021 ExecuteNonQuery net472 2.79μs 7.1ns 27.5ns 0.152 0.0139 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.77μs 8.25ns 34ns 0 0 0 1.04 KB
master CallElasticsearch netcoreapp3.1 2.27μs 9.29ns 36ns 0 0 0 1.04 KB
master CallElasticsearch net472 3.48μs 3.06ns 11.8ns 0.155 0 0 1.05 KB
master CallElasticsearchAsync net6.0 1.82μs 2.09ns 7.81ns 0 0 0 1.02 KB
master CallElasticsearchAsync netcoreapp3.1 2.38μs 3.9ns 15.1ns 0 0 0 1.09 KB
master CallElasticsearchAsync net472 3.62μs 3.69ns 14.3ns 0.162 0 0 1.11 KB
#7021 CallElasticsearch net6.0 1.83μs 1.26ns 4.89ns 0 0 0 1.04 KB
#7021 CallElasticsearch netcoreapp3.1 2.29μs 11ns 44ns 0 0 0 1.04 KB
#7021 CallElasticsearch net472 3.51μs 2.78ns 10.8ns 0.158 0 0 1.05 KB
#7021 CallElasticsearchAsync net6.0 1.79μs 1.14ns 4.41ns 0 0 0 1.02 KB
#7021 CallElasticsearchAsync netcoreapp3.1 2.41μs 8.66ns 32.4ns 0 0 0 1.09 KB
#7021 CallElasticsearchAsync net472 3.69μs 1.75ns 6.77ns 0.166 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.75μs 6.92ns 26.8ns 0 0 0 960 B
master ExecuteAsync netcoreapp3.1 2.43μs 4.44ns 17.2ns 0 0 0 960 B
master ExecuteAsync net472 2.5μs 2.92ns 11.3ns 0.138 0 0 923 B
#7021 ExecuteAsync net6.0 1.75μs 8.99ns 40.2ns 0 0 0 960 B
#7021 ExecuteAsync netcoreapp3.1 2.32μs 7.63ns 29.6ns 0 0 0 960 B
#7021 ExecuteAsync net472 2.54μs 2.01ns 7.53ns 0.14 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.96μs 12.6ns 48.6ns 0 0 0 2.37 KB
master SendAsync netcoreapp3.1 8.67μs 19.7ns 76.2ns 0 0 0 2.9 KB
master SendAsync net472 12.3μs 4.94ns 18.5ns 0.494 0 0 3.19 KB
#7021 SendAsync net6.0 6.83μs 12.2ns 47.1ns 0 0 0 2.37 KB
#7021 SendAsync netcoreapp3.1 8.63μs 6.82ns 26.4ns 0 0 0 2.9 KB
#7021 SendAsync net472 12μs 9.55ns 37ns 0.479 0 0 3.19 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7021

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.34 KB 65.54 KB 8.19 KB 14.29%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 259.07 KB 261.56 KB 2.49 KB 0.96%

Fewer allocations 🎉 in #7021

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 277.86 KB 275.41 KB -2.46 KB -0.88%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 44.34 KB 43.15 KB -1.18 KB -2.67%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 44.8μs 312ns 2.93μs 0 0 0 44.34 KB
master StringConcatBenchmark netcoreapp3.1 48.4μs 386ns 3.62μs 0 0 0 42.78 KB
master StringConcatBenchmark net472 57.5μs 255ns 988ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 477μs 878ns 3.04μs 0 0 0 259.07 KB
master StringConcatAspectBenchmark netcoreapp3.1 547μs 2.6μs 10.7μs 0 0 0 277.86 KB
master StringConcatAspectBenchmark net472 407μs 2.22μs 13.7μs 0 0 0 278.53 KB
#7021 StringConcatBenchmark net6.0 41μs 204ns 842ns 0 0 0 43.15 KB
#7021 StringConcatBenchmark netcoreapp3.1 46.6μs 237ns 1.23μs 0 0 0 42.64 KB
#7021 StringConcatBenchmark net472 57.5μs 153ns 574ns 0 0 0 65.54 KB
#7021 StringConcatAspectBenchmark net6.0 478μs 2.15μs 7.74μs 0 0 0 261.56 KB
#7021 StringConcatAspectBenchmark netcoreapp3.1 548μs 2.73μs 11.3μs 0 0 0 275.41 KB
#7021 StringConcatAspectBenchmark net472 401μs 2.3μs 18.6μ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.57μs 10.3ns 39.8ns 0 0 0 1.76 KB
master EnrichedLog netcoreapp3.1 3.45μs 17ns 74.1ns 0 0 0 1.76 KB
master EnrichedLog net472 3.91μs 1.87ns 7.26ns 0.255 0 0 1.69 KB
#7021 EnrichedLog net6.0 2.62μs 4.98ns 18.6ns 0 0 0 1.76 KB
#7021 EnrichedLog netcoreapp3.1 3.44μs 16.5ns 64ns 0 0 0 1.76 KB
#7021 EnrichedLog net472 3.87μs 4.22ns 16.3ns 0.254 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 123μs 48.9ns 176ns 0 0 0 4.37 KB
master EnrichedLog netcoreapp3.1 128μs 229ns 827ns 0 0 0 4.37 KB
master EnrichedLog net472 167μs 41.5ns 155ns 0 0 0 4.57 KB
#7021 EnrichedLog net6.0 122μs 50.8ns 183ns 0 0 0 4.37 KB
#7021 EnrichedLog netcoreapp3.1 128μs 264ns 987ns 0 0 0 4.37 KB
#7021 EnrichedLog net472 168μs 234ns 904ns 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.15μs 13ns 50.3ns 0 0 0 2.32 KB
master EnrichedLog netcoreapp3.1 6.4μs 22.4ns 86.8ns 0 0 0 2.32 KB
master EnrichedLog net472 7.46μs 6.79ns 26.3ns 0.337 0 0 2.14 KB
#7021 EnrichedLog net6.0 5.15μs 13.9ns 53.9ns 0 0 0 2.32 KB
#7021 EnrichedLog netcoreapp3.1 6.71μs 13.4ns 52ns 0 0 0 2.32 KB
#7021 EnrichedLog net472 7.38μs 7.58ns 29.3ns 0.331 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 1.98μs 10.1ns 49.7ns 0 0 0 1.21 KB
master SendReceive netcoreapp3.1 2.57μs 9.19ns 35.6ns 0 0 0 1.21 KB
master SendReceive net472 3.06μs 3.31ns 12.8ns 0.183 0 0 1.21 KB
#7021 SendReceive net6.0 2.04μs 1.96ns 7.6ns 0 0 0 1.21 KB
#7021 SendReceive netcoreapp3.1 2.57μs 12.8ns 55.7ns 0 0 0 1.21 KB
#7021 SendReceive net472 3.04μs 1.84ns 6.88ns 0.183 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.37μs 7.63ns 28.5ns 0 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 5.62μs 15.1ns 58.5ns 0 0 0 1.69 KB
master EnrichedLog net472 6.48μs 4.01ns 15.5ns 0.323 0 0 2.08 KB
#7021 EnrichedLog net6.0 4.18μs 6.95ns 26.9ns 0 0 0 1.64 KB
#7021 EnrichedLog netcoreapp3.1 5.59μs 20.8ns 80.5ns 0 0 0 1.69 KB
#7021 EnrichedLog net472 6.55μs 6.57ns 25.5ns 0.326 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 757ns 0.25ns 0.967ns 0 0 0 584 B
master StartFinishSpan netcoreapp3.1 957ns 4.84ns 22.2ns 0 0 0 584 B
master StartFinishSpan net472 919ns 0.784ns 3.04ns 0.0927 0 0 586 B
master StartFinishScope net6.0 890ns 4.81ns 25.9ns 0 0 0 704 B
master StartFinishScope netcoreapp3.1 1.12μs 5.99ns 33.3ns 0 0 0 704 B
master StartFinishScope net472 1.14μs 1.06ns 4.12ns 0.102 0 0 666 B
#7021 StartFinishSpan net6.0 743ns 0.406ns 1.52ns 0 0 0 584 B
#7021 StartFinishSpan netcoreapp3.1 926ns 4.34ns 17.4ns 0 0 0 584 B
#7021 StartFinishSpan net472 913ns 0.219ns 0.846ns 0.0914 0 0 586 B
#7021 StartFinishScope net6.0 882ns 4.49ns 21.1ns 0 0 0 704 B
#7021 StartFinishScope netcoreapp3.1 1.22μs 5.64ns 21.8ns 0 0 0 704 B
#7021 StartFinishScope net472 1.14μs 0.532ns 2.06ns 0.103 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 4.83ns 19.3ns 0 0 0 704 B
master RunOnMethodBegin netcoreapp3.1 1.35μs 6.37ns 24.7ns 0 0 0 704 B
master RunOnMethodBegin net472 1.36μs 0.699ns 2.71ns 0.102 0 0 666 B
#7021 RunOnMethodBegin net6.0 1μs 5.23ns 24ns 0 0 0 704 B
#7021 RunOnMethodBegin netcoreapp3.1 1.41μs 7.16ns 31.2ns 0 0 0 704 B
#7021 RunOnMethodBegin net472 1.41μs 0.734ns 2.84ns 0.0989 0 0 666 B

@datadog-datadog-prod-us1
Copy link

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

Datadog Report

Branch report: nacho/DefaultTimeoutAndRetries
Commit report: 610d94b
Test service: dd-trace-dotnet

✅ 0 Failed, 246787 Passed, 2294 Skipped, 15h 23m 20.11s Total Time

@andrewlock
Copy link
Member

andrewlock commented May 28, 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 (7021) - mean (68ms)  : 65, 71
     .   : milestone, 68,
    master - mean (68ms)  : 65, 72
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (7021) - mean (1,007ms)  : 987, 1027
     .   : milestone, 1007,
    master - mean (1,006ms)  : 988, 1023
     .   : milestone, 1006,

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

    section CallTarget+Inlining+NGEN
    This PR (7021) - mean (693ms)  : 675, 712
     .   : milestone, 693,
    master - mean (694ms)  : 671, 717
     .   : milestone, 694,

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

    section CallTarget+Inlining+NGEN
    This PR (7021) - mean (647ms)  : 628, 667
     .   : milestone, 647,
    master - mean (657ms)  : 632, 682
     .   : milestone, 657,

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

    section CallTarget+Inlining+NGEN
    This PR (7021) - mean (1,115ms)  : 1082, 1149
     .   : milestone, 1115,
    master - mean (1,112ms)  : 1092, 1133
     .   : milestone, 1112,

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

    section CallTarget+Inlining+NGEN
    This PR (7021) - mean (882ms)  : 844, 921
     .   : milestone, 882,
    master - mean (880ms)  : 846, 914
     .   : milestone, 880,

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

    section CallTarget+Inlining+NGEN
    This PR (7021) - mean (868ms)  : 841, 896
     .   : milestone, 868,
    master - mean (873ms)  : 823, 923
     .   : milestone, 873,

Loading

inputs:
artifact: ${{ parameters.artifact }}
path: ${{ parameters.path }}
patterns: ${{ parameters.patterns }}
Copy link
Contributor Author

@NachoEchevarria NachoEchevarria May 28, 2025

Choose a reason for hiding this comment

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

While this adds a global timeout and retry values, the task would fail if a single download task takes more than 45 minutes. The ideal solution would be to set a global timeout and cancel a particular download task after something like 20 mins and retry. Doing that would not be very straightforward, but we could do something like this. Still, pretty ugly.

parameters:
  artifact: ''
  path: ''
  patterns: ''
  displayName: ''
  condition: ''
  timeoutInMinutes: 45
  retryCountOnTaskFailure: 3

steps:
- bash: |
    max_retries=${{ parameters.retryCountOnTaskFailure }}
    attempt=1
    end=$((SECONDS + ${{ parameters.timeoutInMinutes }} * 60))

    while [ $attempt -le $max_retries ] && [ $SECONDS -lt $end ]; do
      echo "Attempt $attempt of $max_retries..."

      timeout 1200 az pipelines runs artifact download \
        --artifact-name "${{ parameters.artifact }}" \
        --path "${{ parameters.path }}" \
        --patterns "${{ parameters.patterns }}"
      
      exit_code=$?
      if [ $exit_code -eq 0 ]; then
        echo "Artifact download successful on attempt $attempt."
        exit 0
      else
        echo "Attempt $attempt failed (exit code $exit_code)."
        if [ $attempt -lt $max_retries ]; then
          echo "Retrying after short delay..."
          sleep 30
        fi
      fi

      attempt=$((attempt + 1))
    done

    echo "All attempts failed or global timeout exceeded."
    exit 1
  displayName: ${{ parameters.displayName }}
  condition: ${{ parameters.condition }}
  timeoutInMinutes: ${{ parameters.timeoutInMinutes }}

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.

I would suggest deleting the displayName parameter (or at the very least , most usages of it.

artifact: ''
path: ''
patterns: ''
displayName: ''
Copy link
Member

Choose a reason for hiding this comment

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

Meh, I think we can probably just remove this tbh, the artifact name tells you what it is - it was mostly there because if you don't provide it, it just says "Download artifact" instead

@NachoEchevarria NachoEchevarria marked this pull request as ready for review May 29, 2025 10:58
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner May 29, 2025 10:58
@NachoEchevarria NachoEchevarria merged commit a0b8433 into master May 29, 2025
128 checks passed
@NachoEchevarria NachoEchevarria deleted the nacho/DefaultTimeoutAndRetries branch May 29, 2025 13:45
@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