Skip to content

Commit 9cc54da

Browse files
committed
Retry rename on lock induced failures (re-fix) (go-gitea#16461)
Backport go-gitea#16461 Unfortunately go-gitea#16435 asserts the wrong error and should use os.LinkError not os.PathError. Fix go-gitea#16439 Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent 62fa153 commit 9cc54da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/util/remove.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func Rename(oldpath, newpath string) error {
6464
if err == nil {
6565
break
6666
}
67-
unwrapped := err.(*os.PathError).Err
67+
unwrapped := err.(*os.LinkError).Err
6868
if unwrapped == syscall.EBUSY || unwrapped == syscall.ENOTEMPTY || unwrapped == syscall.EPERM || unwrapped == syscall.EMFILE || unwrapped == syscall.ENFILE {
6969
// try again
7070
<-time.After(100 * time.Millisecond)

0 commit comments

Comments
 (0)