Skip to content

Commit

Permalink
Retry rename on lock induced failures (re-fix)
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 <[email protected]>
  • Loading branch information
zeripath committed Jul 16, 2021
1 parent 95f4004 commit fc01ed8
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 fc01ed8

Please sign in to comment.