aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeripath2021-07-16 17:48:39 +0100
committerGitHub2021-07-16 17:48:39 +0100
commite6c222511dec43565d869fd805fce214049e6776 (patch)
treef4df36fe8969e0be7568a53ff4cc72cccca8de1c
parent62fa153f9f36fed810e99f6f53f93dd756288096 (diff)
Retry rename on lock induced failures (re-fix) (#16461) (#16463)
Backport #16461 Unfortunately #16435 asserts the wrong error and should use os.LinkError not os.PathError. Fix #16439 Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r--modules/util/remove.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/util/remove.go b/modules/util/remove.go
index 231043652..754f3b7c1 100644
--- a/modules/util/remove.go
+++ b/modules/util/remove.go
@@ -64,7 +64,7 @@ func Rename(oldpath, newpath string) error {
if err == nil {
break
}
- unwrapped := err.(*os.PathError).Err
+ unwrapped := err.(*os.LinkError).Err
if unwrapped == syscall.EBUSY || unwrapped == syscall.ENOTEMPTY || unwrapped == syscall.EPERM || unwrapped == syscall.EMFILE || unwrapped == syscall.ENFILE {
// try again
<-time.After(100 * time.Millisecond)