8000 Add retry logic to RegistryServiceClient network calls · Issue #1047 · dotnet/docker-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add retry logic to RegistryServiceClient network calls #1047
Open
@mthalman

Description

@mthalman

A recent exception occurred when attempting to get digest values of images from the RegistryServiceClient class:

Unhandled exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 503 (Service Unavailable).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at Microsoft.DotNet.ImageBuilder.RegistryHttpClient.RegistryOAuthDelegatingHandler.GetOAuthTokenAsync(HttpResponseMessage response, HttpRequestMessage unauthorizedRequest, CancellationToken cancellationToken) in /image-builder/src/RegistryHttpClient.cs:line 95
   at Microsoft.DotNet.ImageBuilder.RegistryHttpClient.RegistryOAuthDelegatingHandler.GetAuthenticatedRequestAsync(HttpResponseMessage response, HttpRequestMessage request, CancellationToken cancellationToken) in /image-builder/src/RegistryHttpClient.cs:line 61
   at Microsoft.DotNet.ImageBuilder.RegistryHttpClient.RegistryOAuthDelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /image-builder/src/RegistryHttpClient.cs:line 50
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Microsoft.DotNet.ImageBuilder.RegistryServiceClient.SendRequestAsync(HttpRequestMessage request) in /image-builder/src/RegistryServiceClient.cs:line 76
   at Microsoft.DotNet.ImageBuilder.RegistryServiceClient.GetManifestAsync(String repo, String tagOrDigest) in /image-builder/src/RegistryServiceClient.cs:line 50
   at Microsoft.DotNet.ImageBuilder.ManifestServiceExtensions.GetManifestDigestShaAsync(IManifestService manifestService, String tag, IRegistryCredentialsHost credsHost, Boolean isDryRun) in /image-builder/src/ManifestServiceExtensions.cs:line 43
   at Microsoft.DotNet.ImageBuilder.DockerService.GetImageDigestAsync(String image, IRegistryCredentialsHost credsHost, Boolean isDryRun) in /image-builder/src/DockerService.cs:line 38
   at Microsoft.DotNet.ImageBuilder.LockHelper.<>c__DisplayClass3_0`2.<<DoubleCheckedLockLookupAsync>b__0>d.MoveNext() in /image-builder/src/LockHelper.cs:line 80

This is one of those intermittent issues that can be mitigated with a retry. The class should be updated to compensate for network errors as mentioned in #837.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0