Skip to content

Commit

Permalink
Retry rename on lock induced failures (re-fix) (go-gitea#16461)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zeripath authored and AbdulrhmnGhanem committed Aug 10, 2021
1 parent fa8b277 commit bc48b96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/util/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bc48b96

Please sign in to comment.