Managing HP Serviceguard for Linux, Eighth Edition, March 2008

Designing Highly Available Cluster Applications
Designing Applications to Run on Multiple Systems
Appendix B 351
Avoid File Locking
In an NFS environment, applications should avoid using file-locking
mechanisms, where the file to be locked is on an NFS Server. File locking
should be avoided in an application both on local and remote systems. If
local file locking is employed and the system fails, the system acting as
the backup system will not have any knowledge of the locks maintained
by the failed system. This may or may not cause problems when the
application restarts.
Remote file locking is the worst of the two situations, since the system
doing the locking may be the system that fails. Then, the lock might
never be released, and other parts of the application will be unable to
access that data. In an NFS environment, file locking can cause long
delays in case of NFS client system failure and might even delay the
failover itself.