1. /proc/sys/fs/lease-break-time
[root@localhost /proc/sys/fs]$ cat lease-break-time
45
2. 分析理解
linux有一种lease锁,一个进程试图打开一个lease保护的文件时,该进程被阻塞,锁的持有者会接收到信号。收到信号,锁的持有者进程应该更新文件保持文件的一致性,然后释放锁,如果进程不释放,在一个给定时间后(45秒),内核自动删除该锁,让阻塞的进程继续执行.
这个文件就是保存租借锁的超时时间(以秒为单位)
3. 翻译
这个文件指定文件租约锁的超时时间,内核会分配一个进程处理一个文件租约锁,当其他进程需要打开这个文件时,它会发送一个信号到正在租用这个文件的进程。
如果这个占用该文件的进程在一定时间内没有删除或downgrade这个租约锁,那么操作系统会在超时后强制释放这个锁。
/proc/sys/fs/lease-break-time This file specifies the grace period that the kernel grants to a process holding a file lease (fcntl(2)) after it has sent a signal to that process notify-ing it that another process is waiting to open the file. If the lease holder does not remove or downgrade the lease within this grace period, the kernel forcibly breaks the lease.