Skip to content

SDK 11.0.100 GA: dotnet --version waits 4.5 s and dotnet build 9 s at exit on a Linux machine where 169.254.169.254 does not answer #57036

Open

Description

@thomhurst

Describe the bug

On a Linux machine that is not an Azure VM, every dotnet command under SDK 11.0.100 (GA) waits several seconds before exiting: dotnet --version takes 4.5 s and a no-op dotnet build takes 9.3 s. SDK 10.0.404 on the same machine takes 0.06 s and 0.7 s. The time is spent waiting on connections to the Azure VM metadata address 169.254.169.254:80, which never complete there.

This is the behaviour reported in #56928 and #56815, which were closed as fixed for 11.0.0 by #56863. It still happens on the GA SDK, and the wait is longer than in those reports.

Steps to reproduce

On a Linux machine where connections to 169.254.169.254 are silently dropped (curl -m 12 http://169.254.169.254/ times out), with telemetry at its default:

mkdir repro && cd repro
echo '{"sdk":{"version":"11.0.100","rollForward":"disable"}}' > global.json
dotnet new console -o app && cd app
dotnet build

time dotnet --version
time dotnet build
time dotnet msbuild -version

Expected behavior

The commands exit as soon as their work is done, as they do with SDK 10.0.404 or with DOTNET_CLI_TELEMETRY_OPTOUT=1.

Actual behavior

Wall time, three runs each, all within 0.2 s of the figure shown:

Configuration dotnet --version dotnet build (no-op) dotnet msbuild -version
SDK 10.0.404, default 0.06 s 0.7 s 0.09 s
SDK 11.0.100, default 4.55 s 9.28 s 9.2 s
SDK 11.0.100, DOTNET_CLI_TELEMETRY_OPTOUT=1 0.01 s 0.15 s 0.08 s
SDK 11.0.100, DOTNET_CLI_TELEMETRY_SHUTDOWN_TIMEOUT_MS=0 4.54 s 9.28 s not measured
SDK 11.0.100, default, connections to 169.254.169.254 rejected with a TCP reset (iptables ... -j REJECT --reject-with tcp-reset) 0.55 s 1.27 s 1.2 s

The time is spent waiting, not computing: dotnet --version is real 4.559 user 0.051 sys 0.010, and MSBuild reports Time Elapsed 00:00:00.14 for the 9.28 s build.

strace -f -tt -e trace=connect,exit_group dotnet --version, times relative to the first connection:

  • +0.00 s: connect to the telemetry ingestion endpoint on port 443.
  • +0.55 s: connect to ::ffff:169.254.169.254 port 80 returns EINPROGRESS and never completes.
  • +2.56 s: a second connect to ::ffff:169.254.169.254 port 80.
  • +4.56 s: exit_group(0).

So the process makes two metadata attempts and waits 2 s on each. The same trace of dotnet build shows that sequence twice in a row (attempts at +0.6 s, +2.6 s, +5.2 s and +7.2 s, exit at +9.2 s), which accounts for the 9 s.

On an Azure-hosted machine (GitHub's ubuntu-latest runner), where the metadata address answers in 7 ms, the same SDK takes 0.15 s for dotnet --version and 0.57 s for the no-op build.

Is this a regression?

Yes. SDK 10.0.404 on the same machine is not affected.

Are there any workarounds?

DOTNET_CLI_TELEMETRY_OPTOUT=1 removes the wait.

dotnet --info output

.NET SDK:
 Version:           11.0.100
 Commit:            297acf930f
 Workload version:  11.0.100-manifests.08e30c08
 MSBuild version:   18.12.2-1.26529.118+297acf930

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  24.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/11.0.100

Host:
  Version:      11.0.0
  Architecture: x64
  Commit:       297acf930f

Other details

  • Ubuntu 24.04.5 LTS, x64, a hosted CI virtual machine outside Azure. ip route get 169.254.169.254 resolves through the default gateway; there is no link-local route.
  • No OTEL_*, APPLICATIONINSIGHTS_* or DOTNET_CLI_TELEMETRY_* variables set except where the table says so. DOTNET_NOLOGO=1, DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 and DOTNET_MULTILEVEL_LOOKUP=0 were set.

Could the metadata request be skipped, or not block process exit, in an 11.0.1xx servicing release?

Found while benchmarking build times for TUnit: thomhurst/TUnit#7707

Activity

  1. locked and limited conversation to collaborators on Nov 10, 2026
  2. unlocked this conversation on Nov 10, 2026
  3. github-actions commented on Nov 10, 2026

    @github-actions
    Contributor

    🎯 Agentic Issue Triage

    Triage Assessment:

    • 🏷️ Labels: Area-Telemetry Bug performance needs team triage Requires a full team discussion
    • 💻 Assignment: none | @dotnet/dotnet-cli
    • 🟨 Confidence: medium - Telemetry is the likely area, but CODEOWNERS has no Area-Telemetry section, so routing uses the default team.

    Similar issues: #56928 (duplicate)

    ➡️ Summary: On SDK 11.0.100 GA, Linux hosts where 169.254.169.254 drops packets see dotnet commands stall 4.5–9 s at exit due to telemetry. Team should check whether the fix in #56863 is incomplete.

    Generated by 🏷️ Issue Triage for #57036 · copilot · auto · ~15 AIC · ⌖ ~1 AIC · ⊞ 14.6K · ◷

  4. self-assigned this
    on Nov 10, 2026
  5. removed
    needs team triage
    on Nov 10, 2026
  6. added
    untriaged
    on Nov 10, 2026
  7. baronfel commented on Nov 16, 2026

    @baronfel
    Member

    This is happening because the telemetry library we use to export to Azure is trying to dial out and there's a connection timeout that we don't have direct access to configure/change. We could potentially add some logic to mitigate that, but it's not a general issue with the CLI - it's a specific bug with reaching out to these endpoints in particular.

    In the meantime, instead of (or in addition to) trying to prevent network access via firewall, please also set the CLI telemetry opt-out and you should sidestep all of these issues.

  8. nagilson commented on Nov 16, 2026

    @nagilson
    Member

    I still need to file the issue on the Azure Exporter - to be clear, I think they have a 2s timeout, it's just that they try to reach that ip address to determine if the machine is an azure VM and they always wait the full 2 seconds even if there is no connection to it.

    On the other hand, in the long term we want to switch to a detached drain that doesn't require any waiting on the end here.

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

Metadata

Metadata

Assignees

Labels

Area-TelemetryBugperformanceuntriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions