Christian Halstrick
10e65cb4fa
Fix LockFile semantics when running on NFS
When running on NFS there was a chance that JGits LockFile semantic is broken because File#createNewFile() may allow multiple clients to create the same file in parallel. This change provides a fix which is only used when the new config option core.supportsAtomicCreateNewFile is set to false. The default for this option is true. This option can only be set in the global or the system config file. The repository config file is not taken into account in this case. If the config option core.supportsAtomicCreateNewFile is true then File#createNewFile() is trusted and the behaviour doesn't change. But if core.supportsAtomicCreateNewFile is set to false then after successful creation of the lock file a hardlink to that lock file is created and the attribute nlink of the lock file is checked to be 2. If multiple clients manage to create the same lock file nlink would be greater than 2 showing the error. This expensive workaround is described in https://www.time-travellers.org/shane/papers/NFS_considered_harmful.html section III.d) "Exclusive File Creation" Change-Id: I3d2cc48d8eb280d5f7039eb94da37804f903be6a |
6 år sedan | |
---|---|---|
.. | ||
dfs | Merge "DfsReader: check object type during open" | 7 år sedan |
file | Fix LockFile semantics when running on NFS | 6 år sedan |
pack | PackWriter: Fix Javadoc tag for thrown exception in preparePack | 7 år sedan |
reftree | Support per-BatchRefUpdate atomic transactions | 8 år sedan |