summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-07-16 19:22:44 +0200
committerGitHub <noreply@github.com>2021-07-16 19:22:44 +0200
commit0f11c5f592dd32db71beb5bbbf996f33a1c50f0d (patch)
tree399aa34aeae6ad94b12fea66cae52cabf649bad4 /modules
parentFrontport v1.14.5 (#16453) (diff)
downloadforgejo-0f11c5f592dd32db71beb5bbbf996f33a1c50f0d.tar.xz
forgejo-0f11c5f592dd32db71beb5bbbf996f33a1c50f0d.zip
Retry rename on lock induced failures (re-fix) (#16461) (#16462)
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>
Diffstat (limited to 'modules')
-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 2310436525..754f3b7c11 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)