From 72cd33641012680a954fe2df0e4c2dcfb40bc880 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sun, 19 Nov 2023 00:08:18 -0500 Subject: [PATCH] dont retry on upload complete context cancel --- server/upload.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/upload.go b/server/upload.go index 7e104bc2..abd4e0e7 100644 --- a/server/upload.go +++ b/server/upload.go @@ -196,6 +196,10 @@ func (b *blobUpload) Run(ctx context.Context, opts *RegistryOptions) { resp, err := makeRequestWithRetry(ctx, http.MethodPut, requestURL, headers, nil, opts) if err != nil { b.err = err + if errors.Is(err, context.Canceled) { + return + } + sleep := time.Second * time.Duration(math.Pow(2, float64(try))) log.Printf("%s complete upload attempt %d failed: %v, retrying in %s", b.Digest[7:19], try, err, sleep) time.Sleep(sleep)