0025-EnsureRemoveAll-make-retry-count-from-5-to-50.patch 1.6 KB
Newer Older
W
WangFengTu 已提交
1
From 4f7a72253eb99e24af38ae02059445ae196ba259 Mon Sep 17 00:00:00 2001
O
overweight 已提交
2 3
From: LiFeng <lifeng68@huawei.com>
Date: Mon, 22 Jul 2019 03:52:09 -0400
W
WangFengTu 已提交
4
Subject: [PATCH 25/40] EnsureRemoveAll make retry count from 5 to 50
O
overweight 已提交
5 6 7

Signed-off-by: LiFeng <lifeng68@huawei.com>
---
D
dogsheng 已提交
8 9
 .../github.com/containers/storage/drivers/overlay/overlay.go   | 3 ++-
 vendor/github.com/containers/storage/pkg/system/rm.go          | 2 +-
O
overweight 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
 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)
-- 
D
dogsheng 已提交
42
2.19.1
O
overweight 已提交
43