Expand description
Processes holding a lock file open,
found by device and inode.
What:
Processes holding a lock file open,
found by device and inode:
/proc/<pid>/fd on
Linux,
lsof on macOS,
the Restart Manager on Windows.
Why:
An open descriptor proves a live owner.
Matching by device and inode,
never by path text,
means bind mounts and renamed paths cannot fake or hide a holder.
Processes the scan
cannot read are partial evidence (src/index-lock/index-lock-holders-linux.ts,
-darwin.ts,
-win32.ts).
In TS you’d write (pseudocode):
const evidence = await scanPlatformHolders({ lockPath, lock });Re-exports§
pub use crate::index_lock_holder_parsers::LsofProcess;pub use crate::index_lock_holder_parsers::matching_holders;pub use crate::index_lock_holder_parsers::parse_lsof_fields;pub use crate::index_lock_holder_parsers::parse_lsof_number;pub use crate::index_lock_holder_parsers::parse_restart_manager_output;
Structs§
- Holder
- What:
One process holding the lock open.
Why:
LockHolderProcess. - Holder
Evidence - What:
The scan mechanism,
its holders,
and what it could not see.
Why:
LockHolderEvidence.
Constants§
- RESTART_
MANAGER_ SCRIPT - The incumbent’s Restart Manager script, byte for byte.
- SERVICE_
SCAN_ BUDGET - How long the commit service’s scan for the processes that have a lock open may take.
- SILENT_
DENIAL_ NOTE - Partial-evidence note every unprivileged macOS scan carries.
Functions§
- scan_
platform_ holders - What:
Scan for open holders with the host’s mechanism.
Why:
scanPlatformHolders. - scan_
platform_ holders_ bounded - The scan for open holders that the commit service makes:
the host’s,
bounded in time where the host’s is
/proc. - scan_
proc_ fd_ holders - What:
Every process other than this one holding a file open,
by device and inode,
through a
proc root.
Why:
scanProcFdHolders; processes are scanned one after another (the incumbent runs 16 at once; the result is the same set). - scan_
proc_ fd_ holders_ until - What:
scan_proc_fd_holders, stopping atdeadlinewhen one is given. Why: The commit service scans while commits queue behind it, and a host with many processes must not hold them up beyond a bound: the processes not reached are said in the evidence’s partial reasons, and the holders found so far are kept.