]> Cypherpunks repositories - goredo.git/commit
Fix possible NFS locking issue v2.6.4
authorSergey Matveev <stargrave@stargrave.org>
Sat, 4 Jan 2025 12:18:15 +0000 (15:18 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 4 Jan 2025 12:37:50 +0000 (15:37 +0300)
commit43d897846589ea7fbb6d2b0372a9afe84702633c
tree320f51f45c61c75b4002d5d1422b4b554fe47243
parent19e4d4d1ce855b2229bc891800391a9b286ca7c6
Fix possible NFS locking issue

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
doc/news.texi
run.go
usage.go