image
image copied to clipboard
Fail earlier when a layer copy fails
Currently, if a layer copy while copying an image causes a hard failure, we still continue to copy all other layers to completion, and we only detect the error after all other layer copies finish.
That can probably be improved — on an error, at the very least don’t schedule any layer copies that didn’t yet start. Probably, immediately cancel the context (and then correctly report the right error).
See also the various “This can take quite some time” comments around non-obviously-cancellable io.Copy calls, and look for other relevant locations (e.g. dockerImageSource.GetBlobAt doesn’t do much about cancellation).