Expand description
gc: the shared startup sweep, then the pair-record collector with the dead-seen grace
(spec “Pairing contract”, gc).
Every decision and every path keys on the id in the FILE NAME (pair.<id>.json), validated
first: pairing::read_record and list_records key on it too, and this module deletes files.
gc never opens a log: the caller (the gc subcommand, or pair with its own log) owns that.
Structs§
Enums§
- Verdict 🔒
- What the two sides add up to.
Constants§
- DEAD_
SEEN_ GRACE_ MS - A pair is collected only when its
dead-seenis strictly older than this. - UNKNOWN_
GRACE_ MS - A side
unknownfor strictly more than this counts as dead.
Functions§
- active_
sessions 🔒 session.activeread once: the set of active session ids, orNonewhen it cannot be read.- delete_
pair 🔒 - Delete every file of the pair, the record last. Nothing is deleted when any entry is not a regular file.
- gc
- The sweep, then the record loop (skipped when
session.activecannot be read).before_deleteis the test failpoint, called after the grace has elapsed and before the liveness is re-read for the deletion decision; every real caller passesNone. - load_
record 🔒 - The record behind
pair.<id>.json, keyed on the file name: a regular file (never a symlink) that parses (read_recordkeys it on the file name’s id). - mtime_
ms 🔒 - pair_
file 🔒 - pair_
files_ 🔒deletable - Every
pair.<id>.*entry must be a regular file directly in the home (no symlink, no directory). - read_
dead_ 🔒seen dead-seencontent as<epoch ms>; absent or unparsable isNone.- remove_
dead_ 🔒seen - tui_
pid_ 🔒file - The pid sentinel that produced an
unknownTUI reading: the record’s generation when it has atui-pid, else the highest generation that has one (the ruleside_livenessapplies). - unknown_
age_ 🔒ms - Age of an
unknownside: the mtime of its sentinel, else the record’screated. - verdict 🔒
- write_
dead_ 🔒seen