Skip to content

Handle 404 in GetAllImageDigestsFromRegistryAsync#2055

Merged
lbussell merged 3 commits intodotnet:mainfrom
lbussell:handle-digest-404
Mar 31, 2026
Merged

Handle 404 in GetAllImageDigestsFromRegistryAsync#2055
lbussell merged 3 commits intodotnet:mainfrom
lbussell:handle-digest-404

Conversation

@lbussell
Copy link
Copy Markdown
Member

When enumerating manifests from the registry, a manifest can be deleted between the time it is listed by GetAllManifestPropertiesAsync and when GetManifestAsync attempts to fetch it.

This race condition can occur when the registry has retention policies that delete images or if there is a concurrent cleanup operation happening.

This PR catches RequestFailedException with status 404 and skips the missing manifest instead of crashing the entire command.

…meration

When enumerating manifests from the registry, a manifest can be deleted
between the time it is listed by GetAllManifestPropertiesAsync and when
GetManifestAsync attempts to fetch it. This race condition occurs when
the registry has retention policies or concurrent cleanup operations.

Catch RequestFailedException with status 404 and skip the manifest
instead of crashing the entire command.

This was the root cause of the cleanup pipeline
(cleanup-acr-images-official) failing consistently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lbussell lbussell merged commit 919fe3c into dotnet:main Mar 31, 2026
12 checks passed
@lbussell lbussell deleted the handle-digest-404 branch March 31, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants