Skip to main content

Module index_lock_holders

Module index_lock_holders 

Source
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.
HolderEvidence
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 at deadline when 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.