fix: do not retry multipart upload chunk on 404 (upload session not found)

This commit is contained in:
water
2026-08-27 11:59:52 +01:00
committed by Nick Craig-Wood
parent 9dbfd9d852
commit 5d1feea7e8
+2 -3
View File
@@ -2681,9 +2681,8 @@ func (o *Object) uploadFragment(ctx context.Context, url string, start int64, to
}
return true, fmt.Errorf("retry this chunk skipping %d bytes: %w", skip, err)
} else if err != nil && resp != nil && resp.StatusCode == http.StatusNotFound {
fs.Debugf(o, "Received 404 error: assuming eventual consistency problem with session - retrying chunk: %v", err)
time.Sleep(5 * time.Second) // a little delay to help things along
return true, err
fs.Debugf(o, "Received 404 error: upload session not found - not retrying: %v", err)
return false, fserrors.NoLowLevelRetryError(err)
}
if err != nil {
return shouldRetry(ctx, resp, err)