Skip to main content

Module process_identity

Module process_identity 

Source
Expand description

Pid-reuse-safe process liveness.

What assembly::discovery (the daemon singleton lock) asks of a recorded holder: is this pid still the process that wrote it, or did the pid get recycled by something unrelated.

Structs§

ProcessIdentity
A process, identified precisely enough to answer “is this still the same process I saw before, or did its pid get recycled?” — a bare pid can’t answer that on its own.

Enums§

ProcessLiveness
StaleLockDecision
What a caller weighing whether to reclaim a stale lock/discovery file should do, given a ProcessLiveness.

Functions§

decide_stale_lock
Runs ProcessIdentity::check against recorded and logs the decision via tracing, so call sites just branch on the result instead of each re-matching all four ProcessLiveness variants and re-writing the same log lines. subject names what’s being checked (e.g. "daemon.lock") and path is where it lives on disk — both go into the log for post-mortem debugging.
process_start_time
pid’s process start time as Unix epoch seconds (rounded to the nearest second — see ProcessIdentity::check’s tolerance for why sub-second precision isn’t needed), or None if it can’t be determined (process gone by the time we looked, ps unavailable, or a read/parse failure — all treated the same by callers: “couldn’t verify, can’t use this for the reuse check”).