pub enum LockForce {
No,
IfNotLive,
EvenIfLive,
}Expand description
How aggressively EventLog::acquire may steal an existing lock.
A holder that is provably DEAD is always stolen (a stale lock from a
crashed engine), regardless of tier. The tiers only govern holders that
are alive or of indeterminate liveness. Automatic Dead detection is
unix-only (kill(pid, 0) returning ESRCH, plus the own-pid
token-reuse screen on any platform): on non-unix targets only the
own-pid token-reuse screen can ever yield Dead, so recovering the lock
from a foreign crashed holder there always requires an explicit force
tier (--force-lock / --dangerously-steal-live-lock).
| holder liveness | No | IfNotLive | EvenIfLive |
|---|---|---|---|
| Dead | steal | steal | steal |
| Unknown | LockHeld | steal | steal |
| Alive | LockHeld | LockHeld | steal (loud) |
Variants§
No
Honor any lock whose holder is not provably dead.
IfNotLive
--force-lock: steal unless the holder is provably ALIVE. This is the
historical force behavior on platforms/lockfiles where liveness cannot
be probed (Unknown), but it refuses to rip the lock from a running
engine.
EvenIfLive
--dangerously-steal-live-lock: steal even from a live holder. Only
correct when the operator has verified the holder is a zombie or an
unrelated (pid-reused) process — stealing from a live kranz engine
means two engines write one log.