mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Don't retry downloads when disk is full
There was already a check that prevented protocol-level fallback in this situation, but retries within a specific protocol will still happen. This makes it take a long time for the pull to finally error out. This fixes slowness in TestDaemonNoSpaceleftOnDeviceError, which used to take a long time due to the backoff between retry attempts: PASS: docker_cli_daemon_test.go:1868: DockerDaemonSuite.TestDaemonNoSpaceleftOnDeviceError 5.882s Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
parent
e08cf4fd80
commit
2d678f5120
1 changed files with 5 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/docker/distribution"
|
"github.com/docker/distribution"
|
||||||
|
@ -149,6 +150,10 @@ func retryOnError(err error) error {
|
||||||
return retryOnError(v.Err)
|
return retryOnError(v.Err)
|
||||||
case *client.UnexpectedHTTPResponseError:
|
case *client.UnexpectedHTTPResponseError:
|
||||||
return xfer.DoNotRetry{Err: err}
|
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
|
// let's be nice and fallback if the error is a completely
|
||||||
// unexpected one.
|
// unexpected one.
|
||||||
|
|
Loading…
Reference in a new issue