Skip to content

Commit e6c2225

Browse files
authored
Retry rename on lock induced failures (re-fix) (#16461) (#16463)
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>
1 parent 62fa153 commit e6c2225

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)