Updated
On this page
Crash-recovery operations: reclaim_interrupted cancels stuck tasks, reevaluate_blocked finds unblocked tasks, and clean_orphaned fails runs whose lock holder crashed, attributed to the system principal.
#trace.src.orxtra.trace._recovery
#trace.src.orxtra.trace._recovery
#_resolve_system_principal_id
python
async def _resolve_system_principal_id(conn: asyncpg.pool.PoolConnectionProxy[asyncpg.Record]) -> UUIDResolve the singleton system principal id, or hard-error if unseeded.
Crash-recovery events are emitted by the machinery itself, not by any run or caller, so they attribute to the SYSTEM principal. There is no silent NULL or inline-subquery path: if the system principal row is absent the database was never seeded, which is a hard error (matches the wording used by resolve_caller_principal in the services/identity layer).
#reclaim_interrupted
python
async def reclaim_interrupted(pool: asyncpg.Pool) -> int#reevaluate_blocked
python
async def reevaluate_blocked(pool: asyncpg.Pool) -> list[UUID]#clean_orphaned
python
async def clean_orphaned(pool: asyncpg.Pool) -> int