Skip to main content

Module liveness

Module liveness 

Source
Expand description

Process-liveness tracking via OS advisory locks.

Each session holds an exclusive flock on .oxicode/issues/.alive/<session_id>. The lock is released by the OS when the process exits (including crashes and kill -9). This lets us answer “is session X still alive?” without any wall-clock timeout, PID-recycling heuristics, or heartbeats.

Structs§

AliveGuard
RAII guard for an acquired alive-lock.
OwnerInfo
Provenance of a live alive-lock holder, persisted inside the lock file.

Constants§

ORPHAN_AGE_SECS
Minimum age (seconds) a dead alive-lock file must reach before reaping.

Functions§

acquire
Try to acquire (and hold) an exclusive advisory lock for session_id.
alive_path
Path of the alive-lock file for session_id under issues_dir.
is_session_alive
Returns true iff a live process currently holds the alive-lock for session_id. Used to decide whether an crate::issues::Assignment is still valid.
read_owner_info
Read back the OwnerInfo recorded by acquire for session_id.
reap_orphans
Best-effort, idempotent cleanup of dead alive-lock files under <issues_dir>/.alive/.