Skip to content

Retry DownloadLibDatadog#8014

Merged
NachoEchevarria merged 2 commits intomasterfrom
nacho/RetrryDownloadLibDatadog
Jan 9, 2026
Merged

Retry DownloadLibDatadog#8014
NachoEchevarria merged 2 commits intomasterfrom
nacho/RetrryDownloadLibDatadog

Conversation

@NachoEchevarria
Copy link
Collaborator

@NachoEchevarria NachoEchevarria commented Dec 26, 2025

Summary of changes

Add retry logic with exponential backoff to the DownloadLibDatadog build step for Windows to handle transient network failures when vcpkg downloads dependencies from GitHub.

Reason for change

CI builds occasionally fail with 504 Gateway Timeout errors when vcpkg attempts to download tools like 7zr.exe from GitHub during the DownloadLibDatadog step. These transient failures cause unnecessary build failures.

Example error from CI:
error: https://github.com/ip7z/7zip/releases/download/25.01/7zr.exe: failed: status code 504

Implementation details

  • Wrap the vcpkg install command in a retry loop (max 3 attempts)
  • Apply exponential backoff between retries: 5s, 10s, 15s
  • Add logging to track attempt numbers and failures
  • Re-throw exception if all retries are exhausted
  • Pattern matches existing DownloadWafVersion retry implementation

Test coverage

Existing CI tests will validate the change. The retry mechanism only activates on failures, so successful builds are unaffected.

Other details

@github-actions github-actions bot added the area:builds project files, build scripts, pipelines, versioning, releases, packages label Dec 26, 2025
@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Dec 26, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8014) 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.28 ± (68.31 - 68.57) ms68.40 ± (68.40 - 68.63) ms+0.2%✅⬆️
.NET Framework 4.8 - Bailout
duration72.15 ± (72.03 - 72.22) ms72.08 ± (72.00 - 72.22) ms-0.1%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1003.70 ± (1004.41 - 1010.09) ms1001.61 ± (1003.45 - 1008.53) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.08 ± (22.04 - 22.12) ms22.01 ± (21.98 - 22.05) ms-0.3%
process.time_to_main_ms78.79 ± (78.65 - 78.93) ms78.73 ± (78.55 - 78.91) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.94 - 10.95) MB10.95 ± (10.94 - 10.96) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.85 ± (21.83 - 21.87) ms21.83 ± (21.80 - 21.85) ms-0.1%
process.time_to_main_ms79.95 ± (79.87 - 80.04) ms80.09 ± (80.00 - 80.18) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.95 - 10.95) MB10.96 ± (10.95 - 10.96) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms223.56 ± (219.87 - 227.26) ms242.66 ± (238.61 - 246.72) ms+8.5%✅⬆️
process.time_to_main_ms471.00 ± (470.49 - 471.51) ms472.50 ± (471.89 - 473.11) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.25 ± (48.23 - 48.27) MB48.24 ± (48.22 - 48.26) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.9%
.NET 6 - Baseline
process.internal_duration_ms20.61 ± (20.58 - 20.64) ms20.61 ± (20.58 - 20.64) ms+0.0%✅⬆️
process.time_to_main_ms67.98 ± (67.86 - 68.10) ms68.12 ± (68.03 - 68.21) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.62 - 10.63) MB10.65 ± (10.64 - 10.65) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.62 ± (20.59 - 20.64) ms20.56 ± (20.53 - 20.59) ms-0.3%
process.time_to_main_ms69.11 ± (69.02 - 69.20) ms69.20 ± (69.12 - 69.27) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.72 ± (10.71 - 10.72) MB10.74 ± (10.73 - 10.74) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms243.67 ± (241.41 - 245.92) ms242.26 ± (239.71 - 244.80) ms-0.6%
process.time_to_main_ms440.16 ± (439.67 - 440.65) ms440.53 ± (440.09 - 440.97) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.64 ± (48.61 - 48.68) MB48.67 ± (48.64 - 48.70) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms18.83 ± (18.80 - 18.85) ms18.91 ± (18.88 - 18.94) ms+0.4%✅⬆️
process.time_to_main_ms67.20 ± (67.08 - 67.31) ms67.28 ± (67.17 - 67.38) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.69) MB7.68 ± (7.67 - 7.69) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.85 ± (18.82 - 18.87) ms18.90 ± (18.87 - 18.93) ms+0.3%✅⬆️
process.time_to_main_ms68.12 ± (68.06 - 68.18) ms68.47 ± (68.41 - 68.52) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.77 ± (7.75 - 7.78) MB7.74 ± (7.73 - 7.75) MB-0.3%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms179.17 ± (178.17 - 180.16) ms180.22 ± (179.10 - 181.33) ms+0.6%✅⬆️
process.time_to_main_ms425.40 ± (424.77 - 426.02) ms425.56 ± (424.94 - 426.17) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.33 ± (36.29 - 36.37) MB36.30 ± (36.27 - 36.33) MB-0.1%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.2%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration192.90 ± (192.96 - 193.70) ms193.62 ± (193.39 - 194.07) ms+0.4%✅⬆️
.NET Framework 4.8 - Bailout
duration196.75 ± (196.47 - 196.87) ms196.88 ± (196.74 - 197.27) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1110.81 ± (1114.41 - 1122.66) ms1111.64 ± (1112.04 - 1117.96) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms187.31 ± (186.97 - 187.65) ms187.57 ± (187.24 - 187.91) ms+0.1%✅⬆️
process.time_to_main_ms80.35 ± (80.18 - 80.52) ms80.67 ± (80.49 - 80.86) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.12 - 16.17) MB16.11 ± (16.08 - 16.14) MB-0.2%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms187.31 ± (186.93 - 187.68) ms187.54 ± (187.16 - 187.93) ms+0.1%✅⬆️
process.time_to_main_ms82.01 ± (81.86 - 82.17) ms82.25 ± (82.08 - 82.42) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.13 - 16.19) MB16.17 ± (16.15 - 16.20) MB+0.1%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.0%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms424.71 ± (421.51 - 427.90) ms413.35 ± (409.90 - 416.80) ms-2.7%
process.time_to_main_ms474.89 ± (474.26 - 475.52) ms474.96 ± (474.36 - 475.56) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.58 ± (58.47 - 58.70) MB58.79 ± (58.67 - 58.92) MB+0.4%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 30)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.64 ± (192.22 - 193.06) ms191.69 ± (191.29 - 192.09) ms-0.5%
process.time_to_main_ms69.95 ± (69.76 - 70.14) ms69.95 ± (69.80 - 70.10) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.03 ± (15.88 - 16.18) MB16.03 ± (15.88 - 16.18) MB+0.0%✅⬆️
runtime.dotnet.threads.count19 ± (18 - 19)18 ± (18 - 19)-1.5%
.NET 6 - Bailout
process.internal_duration_ms191.18 ± (190.93 - 191.43) ms191.45 ± (191.14 - 191.77) ms+0.1%✅⬆️
process.time_to_main_ms70.72 ± (70.62 - 70.82) ms71.13 ± (71.03 - 71.24) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.99 ± (15.84 - 16.14) MB16.00 ± (15.84 - 16.16) MB+0.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.5%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms445.60 ± (442.57 - 448.63) ms449.95 ± (447.14 - 452.76) ms+1.0%✅⬆️
process.time_to_main_ms445.06 ± (444.58 - 445.54) ms445.50 ± (444.93 - 446.07) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.59 ± (58.46 - 58.72) MB58.39 ± (58.28 - 58.50) MB-0.3%
runtime.dotnet.threads.count30 ± (29 - 30)29 ± (29 - 30)-0.1%
.NET 8 - Baseline
process.internal_duration_ms190.70 ± (190.28 - 191.13) ms190.71 ± (190.34 - 191.07) ms+0.0%✅⬆️
process.time_to_main_ms69.38 ± (69.20 - 69.56) ms69.57 ± (69.41 - 69.74) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.73 - 11.79) MB11.81 ± (11.78 - 11.83) MB+0.4%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.0%
.NET 8 - Bailout
process.internal_duration_ms189.55 ± (189.30 - 189.81) ms189.58 ± (189.33 - 189.83) ms+0.0%✅⬆️
process.time_to_main_ms70.40 ± (70.32 - 70.48) ms70.48 ± (70.36 - 70.60) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.92 ± (11.89 - 11.95) MB11.83 ± (11.80 - 11.86) MB-0.8%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.7%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms363.77 ± (361.95 - 365.60) ms363.02 ± (361.52 - 364.53) ms-0.2%
process.time_to_main_ms429.88 ± (429.08 - 430.67) ms428.93 ± (428.27 - 429.60) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.96 ± (47.93 - 48.00) MB48.00 ± (47.96 - 48.03) MB+0.1%✅⬆️
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 (8014) - mean (69ms)  : 67, 70
    master - mean (68ms)  : 67, 70

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

    section CallTarget+Inlining+NGEN
    This PR (8014) - mean (1,006ms)  : 970, 1042
    master - mean (1,007ms)  : 967, 1048

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 (8014) - mean (106ms)  : 103, 108
    master - mean (106ms)  : 103, 109

    section Bailout
    This PR (8014) - mean (107ms)  : 106, 109
    master - mean (107ms)  : 106, 108

    section CallTarget+Inlining+NGEN
    This PR (8014) - mean (740ms)  : 668, 812
    master - mean (726ms)  : 661, 791

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

    section Bailout
    This PR (8014) - mean (94ms)  : 93, 96
    master - mean (94ms)  : 93, 96

    section CallTarget+Inlining+NGEN
    This PR (8014) - mean (708ms)  : 661, 754
    master - mean (709ms)  : 675, 744

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

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

    section CallTarget+Inlining+NGEN
    This PR (8014) - mean (634ms)  : 618, 651
    master - mean (632ms)  : 618, 646

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 (8014) - mean (194ms)  : 191, 197
    master - mean (193ms)  : 190, 197

    section Bailout
    This PR (8014) - mean (197ms)  : 194, 200
    master - mean (197ms)  : 195, 199

    section CallTarget+Inlining+NGEN
    This PR (8014) - mean (1,115ms)  : 1073, 1157
    master - mean (1,119ms)  : 1057, 1180

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 (8014) - mean (276ms)  : 272, 281
    master - mean (276ms)  : 270, 282

    section Bailout
    This PR (8014) - mean (278ms)  : 274, 283
    master - mean (278ms)  : 272, 283

    section CallTarget+Inlining+NGEN
    This PR (8014) - mean (922ms)  : 879, 965
    master - mean (928ms)  : 885, 972

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8014) - mean (270ms)  : 265, 276
    master - mean (271ms)  : 265, 277

    section Bailout
    This PR (8014) - mean (271ms)  : 267, 274
    master - mean (270ms)  : 267, 274

    section CallTarget+Inlining+NGEN
    This PR (8014) - mean (924ms)  : 881, 966
    master - mean (918ms)  : 869, 967

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8014) - mean (270ms)  : 265, 276
    master - mean (270ms)  : 265, 275

    section Bailout
    This PR (8014) - mean (270ms)  : 266, 273
    master - mean (269ms)  : 265, 273

    section CallTarget+Inlining+NGEN
    This PR (8014) - mean (824ms)  : 804, 844
    master - mean (825ms)  : 809, 842

Loading

@pr-commenter
Copy link

pr-commenter bot commented Dec 26, 2025

Benchmarks

Benchmark execution time: 2026-01-07 11:34:41

Comparing candidate commit 8f877ab in PR branch nacho/RetrryDownloadLibDatadog with baseline commit b70d8ff in branch master.

Found 5 performance improvements and 5 performance regressions! Performance is the same for 164 metrics, 12 unstable metrics.

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0

  • 🟥 execution_time [+11.778ms; +16.445ms] or [+6.152%; +8.590%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • 🟩 throughput [+4887.732op/s; +6841.417op/s] or [+7.281%; +10.192%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟩 execution_time [-17.781ms; -12.467ms] or [-8.307%; -5.824%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟥 execution_time [+15.832ms; +22.080ms] or [+8.028%; +11.197%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟩 execution_time [-21.727ms; -20.651ms] or [-10.737%; -10.206%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟩 throughput [+173.280op/s; +297.902op/s] or [+13.461%; +23.142%]

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 execution_time [+15.478ms; +16.958ms] or [+8.416%; +9.220%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1

  • 🟥 throughput [-36393.207op/s; -25333.518op/s] or [-8.769%; -6.104%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 throughput [-11204.008op/s; -8697.130op/s] or [-6.453%; -5.009%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 execution_time [-19.647ms; -15.723ms] or [-9.101%; -7.283%]

@datadog-datadog-prod-us1

This comment has been minimized.

@NachoEchevarria NachoEchevarria marked this pull request as ready for review January 8, 2026 09:57
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner January 8, 2026 09:57
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.

Looks great, thanks!

@NachoEchevarria NachoEchevarria merged commit 7378d94 into master Jan 9, 2026
149 checks passed
@NachoEchevarria NachoEchevarria deleted the nacho/RetrryDownloadLibDatadog branch January 9, 2026 10:13
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 9, 2026
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 type:flake-fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants