Say a registry came back only when the call worked, and retry from toRetry's set (issue 457 review)
The streaming blob PUT is left unwaited, with why, since its body cannot be read twice and the POST before it already waited.
This commit is contained in:
@@ -429,6 +429,11 @@ func (r Registry) copyBlob(ctx context.Context, src *source, where upstream, dig
|
||||
if response.ContentLength > 0 {
|
||||
put.ContentLength = response.ContentLength
|
||||
}
|
||||
// **Not waited for if refused** (novox/hq issue 457): the body streams from upstream and cannot be
|
||||
// read twice, so a registry held still between the POST above and this PUT fails the copy with
|
||||
// "its body cannot be read twice" rather than waiting. Accepted: the POST a moment before already
|
||||
// waited the registry out, so the window is the length of one upstream fetch, and the build fails
|
||||
// loudly, to be asked again, rather than buffering every base blob in memory.
|
||||
done, err := r.client().Do(put)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot upload blob %s: %w", digest, err)
|
||||
|
||||
Reference in New Issue
Block a user