Merge pull request #408 from stevvooe/increase-retry-backoff

Backoff retry on verification to give s3 time to propagate
This commit is contained in:
Stephen Day 2015-04-21 13:19:28 -07:00
commit aa09c6c262

View file

@ -59,8 +59,8 @@ func (lw *layerWriter) Finish(dgst digest.Digest) (distribution.Layer, error) {
)
// HACK(stevvooe): To deal with s3's lack of consistency, attempt to retry
// validation on failure. Three attempts are made, backing off 100ms each
// time.
// validation on failure. Three attempts are made, backing off
// retries*100ms each time.
for retries := 0; ; retries++ {
canonical, err = lw.validateLayer(dgst)
if err == nil {
@ -71,7 +71,7 @@ func (lw *layerWriter) Finish(dgst digest.Digest) (distribution.Layer, error) {
Errorf("error validating layer: %v", err)
if retries < 3 {
time.Sleep(100 * time.Millisecond)
time.Sleep(100 * time.Millisecond * time.Duration(retries+1))
continue
}