Skip to main content

Module limit_evidence

Module limit_evidence 

Source
Expand description

One clean turn on an account clears the limit of its other panes (task #2648). A clean turn on an account is evidence for the whole account.

A pane whose run ended on the plan’s usage limit stays limited until the provider’s reset, a clean turn of its own, a sign-in or an account move (limit_wake, limit_probe). When the plan is raised or the limit lifted before the reset, other agents on the same account are already working, and every pane still marked limited, and the account itself (its state is read from its panes’ stored failures, account_blocks_at), waited for the reset days away. So when a turn ends clean on an account, every other pane of that account whose usage limit was stored before that turn began has its failure cleared at once, the held-message replay wakes, and each of those agents is told once to continue, staggered as the reset wake is.

The scan is a map lookup unless some account has a stored limit: [note_limited_blocks] records the accounts when a limit is stored and at start.

Constants§

GRACE_MS
A limit stored less than this before a turn ended clean is left alone: that turn may have been served just before the limit was hit.

Functions§

clean_turn
A turn on block_id ended clean. When its account has other panes still marked limited, clears them, wakes the replay and tells their agents to continue. Returns how many were cleared. A map lookup when no account has a stored limit. BLOCKING when it has (store reads and writes).
note_failure
A usage limit is being stored for block_id (persist_last_failure, before the write): records the pane’s account so a clean turn on it looks for the panes to clear. Reads the account from the pane, not the stored limit, which is not there yet.
note_limited_blocks
Records the accounts of the panes in blocks that hold a usage limit.