1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #19551 from aaronlehmann/fix-retry-on-enospc

Don't retry downloads when disk is full
This commit is contained in:
Tibor Vass 2016-01-21 15:37:50 -05:00
commit 26334b7a7d

View file

@ -6,6 +6,7 @@ import (
"net/http"
"net/url"
"strings"
"syscall"
"time"
"github.com/docker/distribution"
@ -149,6 +150,10 @@ func retryOnError(err error) error {
return retryOnError(v.Err)
case *client.UnexpectedHTTPResponseError:
return xfer.DoNotRetry{Err: err}
case error:
if strings.Contains(err.Error(), strings.ToLower(syscall.ENOSPC.Error())) {
return xfer.DoNotRetry{Err: err}
}
}
// let's be nice and fallback if the error is a completely
// unexpected one.