Skip to content

Handle 404 in GetAllImageDigestsFromRegistryAsync#2055

Open
lbussell wants to merge 1 commit intodotnet:mainfrom
lbussell:handle-digest-404
Open

Handle 404 in GetAllImageDigestsFromRegistryAsync#2055
lbussell wants to merge 1 commit 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>
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