Expand description
Tries wrapper — the CONDITIONAL innermost op-level wrapper (SRD-82 Part
3b). tries: is its sigil: the TOTAL number of attempts an op may make.
- No
triesin scope → the wrapper is not constructed; the op runs single-attempt (the outermost error-handler wrapper records the single-attempt tallies). tries: 1→ identical to no wrapper (single attempt); the cascade skips construction.tries: 0→ the op FAILS WITHOUT EXECUTING: every cycle yields a synthesisedtries_zeroop error, routed through the op’s error policy like any terminal failure. The explicit “never run this” knob.tries: N ≥ 2→ up toNtotal attempts; a retryable attempt failure re-runs the inner op until the budget is spent.
When constructed it owns the whole ATTEMPT→RESULT boundary: it runs the
inner op (adapter) one-or-more times, owns the attempt_* counters,
catches a per-attempt panic, and returns exactly ONE terminal outcome to
the layers above. Everything above it — traversal, result-binding,
metrics, the outermost error-handler wrapper — sees a single result,
never the retries.
Retryability is the ADAPTER’s signal: an ExecutionError::Op whose
retryable flag is set (CQL timeouts/overloads are). The errors:
policy is deliberately NOT consulted here — the two surfaces are
orthogonal; the policy’s retry verb participates only by INJECTING a
tries budget at dispenser build (the SRD-82 Part 3b bridge), never by
steering the loop per-cycle.
Structs§
- Tries
Dispenser - Wraps an inner dispenser with a bounded attempt loop over retryable
attempt failures, owning the
attempt_*metrics and the per-attempt panic catch. Constructed only when atriesbudget of0or≥ 2resolves for the op (see the module doc;1/ absent skip construction).