Skip to content

[release/9.0] Fix intermediate artifact upload collisions for NativeAOT and Mono#125564

Open
lewing wants to merge 2 commits intodotnet:release/9.0from
lewing:fix/intermediate-artifact-collision
Open

[release/9.0] Fix intermediate artifact upload collisions for NativeAOT and Mono#125564
lewing wants to merge 2 commits intodotnet:release/9.0from
lewing:fix/intermediate-artifact-collision

Conversation

@lewing
Copy link
Member

@lewing lewing commented Mar 14, 2026

Problem

The dotnet-runtime-official pipeline on release/9.0 has intermittent "File upload failed even after retry" errors caused by multiple platform jobs uploading arch-independent packages (like Microsoft.NETCore.App.Ref.9.0.15.nupkg) to the same artifact path simultaneously.

Root cause: NativeAOT (27 platforms) all upload to name: NativeAOTRuntimePacks and Mono (7+ matrix expansions) all upload to name: MonoRuntimePacks — using a shared subdirectory within the IntermediateArtifacts artifact. When two jobs finish at the same time, they race to upload the same file, causing blob storage write conflicts.

Compare with CoreCLR, which correctly uses name: $(osGroup)$(osSubgroup)_$(archType) — unique per platform. ✅

Fix

Make each upload name unique per platform (matching the CoreCLR pattern):

Build Type Before After
NativeAOT NativeAOTRuntimePacks NativeAOTRuntimePacks_$(osGroup)$(osSubgroup)_$(archType)
Mono MonoRuntimePacks MonoRuntimePacks_$(osGroup)$(osSubgroup)_$(archType)
Mono multithread MonoRuntimePacks MonoRuntimePacks_multithread_$(osGroup)$(osSubgroup)_$(archType)
CrossAOT MonoRuntimePacks MonoRuntimePacks_crossaot_$(osGroup)$(osSubgroup)_$(archType)
LLVM AOT MonoRuntimePacks MonoRuntimePacks_llvmaot_$(osGroup)$(osSubgroup)_$(archType)

Updated the Workloads job download patterns from IntermediateArtifacts/MonoRuntimePacks/Shipping/... to IntermediateArtifacts/MonoRuntimePacks*/Shipping/... so the wildcard matches all per-platform subdirectories.

The CopyFiles@2 flatten step (*/Shipping/*.nupkg) still works because each platform subdirectory is still a single path segment.

Notes

  • Only affects release/9.0main/release/10.0 have moved to VMR builds
  • Perf pipelines (perf-non-wasm-jobs.yml) use the same pattern but only have single-platform uploads (no collision risk), so no changes needed there

Fixes #125561
Ref: dotnet/dnceng#1916

Multiple platform jobs upload to the same IntermediateArtifacts subdirectory
(NativeAOTRuntimePacks or MonoRuntimePacks), causing concurrent write
conflicts when arch-independent packages like Microsoft.NETCore.App.Ref
are uploaded simultaneously by different platform jobs.

Fix by making each upload name unique per platform, matching the pattern
already used by CoreCLR ($(osGroup)$(osSubgroup)_$(archType)):

- NativeAOT: NativeAOTRuntimePacks_$(osGroup)$(osSubgroup)_$(archType)
- Mono: MonoRuntimePacks_$(osGroup)$(osSubgroup)_$(archType)
- Mono multithread: MonoRuntimePacks_multithread_$(osGroup)$(osSubgroup)_$(archType)
- CrossAOT: MonoRuntimePacks_crossaot_$(osGroup)$(osSubgroup)_$(archType)
- LLVM AOT: MonoRuntimePacks_llvmaot_$(osGroup)$(osSubgroup)_$(archType)

Updated Workloads download patterns to use MonoRuntimePacks* wildcard
to match all per-platform subdirectories.

Fixes dotnet#125561

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

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 updates the release/9.0 runtime-official pipeline to prevent intermittent Azure DevOps artifact upload collisions by making NativeAOT and Mono intermediate artifact subdirectories unique per platform (matching the existing CoreCLR approach).

Changes:

  • Make NativeAOT intermediate artifact upload subdirectory unique per platform via $(osGroup)$(osSubgroup)_$(archType).
  • Make Mono intermediate artifact upload subdirectory unique per platform, including distinct prefixes for multithread/crossaot/llvmaot variants.
  • Update the Workloads job’s DownloadPipelineArtifact patterns to use MonoRuntimePacks* so it can find packages across the new per-platform subdirectories.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Member

@steveisok steveisok left a comment

Choose a reason for hiding this comment

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

We get impacted by this problem enough to make it worth a try.

@lewing lewing changed the title Fix intermediate artifact upload collisions for NativeAOT and Mono [release/9.0] Fix intermediate artifact upload collisions for NativeAOT and Mono Mar 15, 2026
lewing added a commit that referenced this pull request Mar 15, 2026
… all macOS/MacCatalyst (#125568)

## Summary

macOS 15+ returns `EHOSTUNREACH` instead of `EACCES` for UDP broadcast
without `SO_BROADCAST` due to Apple's [Local Network privacy
feature](https://developer.apple.com/forums/thread/765285). The test
expects `SocketError.AccessDenied` but gets
`SocketError.HostUnreachable`.

The existing `ActiveIssue` (from #113313) only disabled on MacCatalyst
x64. The failure affects all macOS 15+ platforms — confirmed on
`osx.15.amd64` in both coreclr and Mono legs in
[#125564](#125564).

## Change

Broadens the `ActiveIssue` from:
```csharp
[ActiveIssue("...", typeof(PlatformDetection), nameof(PlatformDetection.IsMacCatalyst), nameof(PlatformDetection.IsX64Process))]
```
to:
```csharp
[ActiveIssue("...", TestPlatforms.OSX | TestPlatforms.MacCatalyst)]
```

@ManickaP requested this backport in
#114450 (comment).

Fixes #114450 on release/9.0.

cc @liveans @kotlarmilos @ManickaP

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants