Credit backpressure¶
A delegated channel lets monitors exchange calls without asking the nucleus
each time, so the nucleus bounds that freedom in advance. Every active channel
carries two finite budgets from its ChannelGrant: call credit, which bounds
concurrent delegated attempts, and byte credit, which bounds attached bulk
data. A call proceeds only against a reservation, and every reservation is
accounted for when the call ends, whichever way it ends. This page covers the
two budgets, the life of a reservation, and reconciliation after an owner
dies.
The two budgets¶
Call credit is granted as call_credit_limit and bounds the delegated attempts
in flight on the channel at once. Byte credit is granted as byte_credit_limit
and bounds the total bytes of bulk-data attachments reserved at once.
Both are nucleus accounting. Transport queues have hard bounds of their own: queue capacity adds no channel credit, and channel credit adds no queue capacity. See Bounded queues.
The life of a reservation¶
stateDiagram-v2
[*] --> reserved: one call credit and the exact attachment bytes, against an AttemptId
reserved --> committed: dispatch
reserved --> returned: cancelled before dispatch
committed --> returned: normal completion
committed --> abandoned: owner died after dispatch
abandoned --> reclaimed: non-execution proven
abandoned --> charged: execution cannot be excluded
returned --> [*]
reclaimed --> [*]
charged --> [*]
Before dispatch, the nucleus reserves one call credit and the exact attachment
byte count against an AttemptId. Dispatch commits the reservation. A normal
completion returns it once; a second return for the same reservation is
refused.
A reservation cancelled before dispatch returns in full, because nothing was sent. A reservation whose owner dies after dispatch is recorded as abandoned, because the operation may have started.
Reconciling abandoned credit¶
An abandoned reservation is resolved by an explicit reconciliation result:
- reclaim the credit when the call is proven to have never executed;
- charge the credit when execution cannot be excluded.
Until one of the two is recorded, the reservation counts against the channel's budget. See Ambiguous completion.
Epoch invalidation and revocation¶
When the channel epoch is invalidated, every uncommitted reservation returns, every committed reservation becomes abandoned, and the channel accepts no new reservations. Revocation closes the channel only after every reserved credit and byte is returned, reclaimed or charged. See Revocation.
Each credit movement is recorded as an evidence event: credit_reserved,
credit_committed, credit_returned, credit_cancelled,
owner_death_recorded and abandoned_call_reconciled. See
Evidence effects.