Skip to main content

Module attempt_timeout

Module attempt_timeout 

Source
Expand description

Postgres attempt_timeout reconciler (wave 6c).

Mirrors [ff_engine::scanner::attempt_timeout] against the Postgres schema. The Valkey side scans ff:idx:{p:N}:attempt_timeout ZSET for attempts whose lease timeout has lapsed and fires FCALL ff_expire_execution. On Postgres the authority is the ff_attempt.lease_expires_at_ms column (partial index ff_attempt_lease_expiry_idx); an attempt is “timed out” iff its lease has expired AND the ff_exec_core.lifecycle_phase = 'active' (a released lease — lease_expires_at_ms IS NULL — is not a timeout; a terminal attempt is also not a timeout).

Per-row tx: each timeout action (mark attempt interrupted + transition exec_core to either runnable (retries remain) or terminal (exhausted) + emit completion event on terminal) is its own BEGIN/COMMIT, per spec §Constraints.

Functions§

scan_tick
Scan one partition for timed-out attempt leases.