mirror of
https://github.com/xcat2/xcat-dep.git
synced 2026-09-30 14:55:17 +00:00
f23a4e87868689baa795ba9d193d0cb1a0d7e250
XCAT::NFSLock recovered a dead owner's lock under a second lock, lock.break. A process that died after it created lock.break left it in place, and every later acquire timed out even when both processes were dead. The lock and its record were also put in place with rename, which replaces an empty directory, so acquire took over a lock.d that had no owner record. The lock now follows the NFS lock protocol at the top of NFSLock.pm. It uses mkdir, rmdir, unlink and plain writes, and no rename. lock.d/metadata holds the owner identity and a hash, and invalid metadata only causes a retry. Takeover and release both hold lock.borrow, beside lock.d. Only a process on the owner's machine takes over a lock, after it reads the same identity twice and proves that owner dead. acquire retries R times with a wait of T +/- jitter, and --try-unlock-timeout maps to R. Records written by the previous format are invalid metadata and are not taken over. A process that dies while it holds lock.borrow still blocks the lock. The protocol assumes that this does not happen. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Description
No description provided
Languages
C
87.5%
Perl
8.2%
Assembly
1.4%
JavaScript
0.8%
Makefile
0.6%
Other
1.4%