File locking supported on all platforms?
Florian Weimer
fweimer at redhat.com
Sat Jul 11 12:51:32 UTC 2020
* Jonas Konrad:
> Some file systems on Linux, eg old NFS, do not support locking at all.
I don't think it's as bleak as that. Many NFS deployments have a
working lock manager. In other cases, NFS is just used to export
non-shared storage to a machine, so it's sufficient if the machine
performs local lock management only (which does not require the NFS
locking protocol).
> Hmm that's what I feared. So to be really sure I should do an actual
> test. Maybe I can get away with doing two locks on the same file
> within one JVM for testing the feature? I should try that.
That's one of the cases that do NOT work as expected on Linux because
that's how POSIX file locking is required to behave (for all file
systems, including local ones).
If OpenJDK switched to Linux OFD locks, behavior would be closer to the
expected one.
Thanks,
Florian
More information about the nio-dev
mailing list