Skip to content

Commit

Permalink
Retry rename on lock induced failures (re-fix) (#16461) (#16463)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zeripath authored Jul 16, 2021
1 parent 62fa153 commit e6c2225
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 e6c2225

Please sign in to comment.