You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow use of alternate file locking primitives #1542
Currently, RStudio Server uses ::link() for construction of hard links, as the atomicity of this operation is guaranteed on older networked file systems.
However, not all networked filesystems support hard links. For example, the MapR NFS supports neither advisory file locks nor hard links, and so users are unable to use file locks on those systems and hence are limited in the RSP feature set they can use (e.g. multiple sessions). There are a couple ways forward here -- as per https://community.mapr.com/thread/7192
MapR's NFS does not support locking currently. However, directory-operations are atomic, creating a lock file using O_EXCL, and testing for its presence is an alternative to flock() or lockf().
Therefore, we could in theory use '::mkdir()' or '::open(..., O_CREAT | O_EXCL)' as alternatives, and allow users to opt-in to those behaviors in their lockfile configuration file.
It might be worth considering whether we could just automatically detect and use the appropriate primitive based on what operations appear to be supported on the active filesystem, but it's probably better to just leave the onus on the user.
Another idea in this vein is to use touch or similar to organically update the write time of the file by actually writing to it; we've seen some installations on which this call fails:
Activity
jmcphers commentedon Oct 3, 2017
Another idea in this vein is to use
touchor similar to organically update the write time of the file by actually writing to it; we've seen some installations on which this call fails:rstudio/src/cpp/core/file_lock/LinkBasedFileLock.cpp
Line 212 in c764e49
kevinushey commentedon Oct 30, 2019
It looks like this was implemented (fall back to
::open()) with 96d2c1a.