Niklas Böhm reported and fixed:
I was using goredo on an NFS and noticed that I sometimes ran into issues
where my program would fail with the following error:
run.go:234: interrupted system call /gpfs01/.../folders/.redo/1.zip.lock
After doing some digging, it seems like the problem is that calling
unix.FcntlFlock with F_SETLKW can be too slow over an NFS and will get
interrupted (see `man 2 flock`, Section on errors [1]). Apparently there is
an automatic restart mechanism [2], but it's also unreliable, so I thought
it's better to handle it explicitly.
[1]: https://www.man7.org/linux/man-pages/man2/fcntl.2.html#ERRORS
[2]: https://unix.stackexchange.com/questions/509375/what-is-interrupted-system-call
@cindex news
@unnumbered News
+@anchor{Release 2_6_4}
+@section Release 2.6.4
+@itemize
+@item
+ Fix possible NFS locking issue.
+@item
+ Updated dependant libraries.
+@end itemize
+
@anchor{Release 2_6_3}
@section Release 2.6.3
@itemize
tracef(CLock, "LOCK_EX: %s", fdLock.Name())
LockAgain:
if err = unix.FcntlFlock(fdLock.Fd(), unix.F_SETLKW, &flock); err != nil {
- if errors.Is(err, unix.EDEADLK) {
+ if errors.Is(err, unix.EDEADLK) || errors.Is(err, unix.EINTR) {
time.Sleep(10 * time.Millisecond)
goto LockAgain
}
)
const (
- Version = "2.6.3"
+ Version = "2.6.4"
Warranty = `Copyright (C) 2020-2025 Sergey Matveev
This program is free software: you can redistribute it and/or modify