From 4f7a72253eb99e24af38ae02059445ae196ba259 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 22 Jul 2019 03:52:09 -0400 Subject: [PATCH 25/40] EnsureRemoveAll make retry count from 5 to 50 Signed-off-by: LiFeng --- .../github.com/containers/storage/drivers/overlay/overlay.go | 3 ++- vendor/github.com/containers/storage/pkg/system/rm.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vendor/github.com/containers/storage/drivers/overlay/overlay.go b/vendor/github.com/containers/storage/drivers/overlay/overlay.go index 314722a..dfac1f0 100644 --- a/vendor/github.com/containers/storage/drivers/overlay/overlay.go +++ b/vendor/github.com/containers/storage/drivers/overlay/overlay.go @@ -695,9 +695,10 @@ func (d *Driver) Remove(id string) error { } if err := system.EnsureRemoveAll(dir); err != nil && !os.IsNotExist(err) { + lastErr := err cmd := exec.Command("rm", "-rf", dir) if err := cmd.Run(); err != nil { - return err + return lastErr } } return nil diff --git a/vendor/github.com/containers/storage/pkg/system/rm.go b/vendor/github.com/containers/storage/pkg/system/rm.go index fc03c3e..a8c685b 100644 --- a/vendor/github.com/containers/storage/pkg/system/rm.go +++ b/vendor/github.com/containers/storage/pkg/system/rm.go @@ -26,7 +26,7 @@ func EnsureRemoveAll(dir string) error { // track retries exitOnErr := make(map[string]int) - maxRetry := 5 + maxRetry := 50 // Attempt to unmount anything beneath this dir first mount.RecursiveUnmount(dir) -- 2.19.1