pub struct PhasePollSpec {
pub until: String,
pub interval_ms: Option<String>,
pub timeout_ms: Option<String>,
pub max_error_retries: Option<String>,
pub metric_name: Option<String>,
pub on_timeout: Option<String>,
pub require: Vec<String>,
}Expand description
Phase-level poll: block (SRD-75). When set on a
WorkloadPhase, the runner wraps the phase’s cycle
execution in a wall-clock loop that re-runs all ops
per iteration until until (a Polydat boolean expression
over captures) returns true or timeout_ms elapses.
Differs from the per-op PollingDispenser (SRD-32):
per-op poll wraps a SINGLE op with row-count /
json-path emptiness termination; phase-poll wraps
MULTIPLE ops with predicate-over-captures termination.
They coexist; per-op poll is the right tool when a
single op’s response is sufficient to signal
completion.
Fields§
§until: StringPolydat boolean expression evaluated against the phase
scope kernel after each iteration. Compiles into
the phase scope as __poll_until := <until>;
dynamic (re-evaluates per pull) per SRD-11’s “two
evaluation lifecycles” rule. Required.
interval_ms: Option<String>Sleep between iterations, milliseconds. A number or a
{param} / iter-var reference resolved at the phase
gather (unresolvable ⇒ the phase fails up front). Default
1000 (one second).
timeout_ms: Option<String>Overall wall-clock cap, milliseconds. Same
number-or-reference contract as interval_ms. The loop
returns a poll_timeout error if exceeded. Default
300000 (5 minutes).
max_error_retries: Option<String>Consecutive retryable inner-op errors tolerated
before propagation. Same number-or-reference contract
as interval_ms. 0 (default) = strict: any
retryable error fails the phase immediately.
Mirrors per-op PollingDispenser semantics.
metric_name: Option<String>Named metric (gauge) written via ctx.wires.write
when the loop terminates successfully. Value =
elapsed wall-clock; unit decoded from the
trailing suffix (_s / _ms / _ns / …) per
the existing duration_value_for_metric_name
convention. Same contract as per-op poll’s
metric_name. Default None (no metric).
on_timeout: Option<String>What to do when the wall-clock timeout_ms
expires without satisfying until. SRD-75
§“Workload-load validation” — the workload-author
declares whether a stuck synchronizer is a
recoverable phase-error or a workload-invalidating
event.
error(default) — phase fails; the outer scenario’s error-routing policy decides whether to continue to sibling phases. Suitable when a single cell’s failed synchronization doesn’t invalidate the rest of the sweep (rare).abort— callssession_signals::request_stop()in addition to setting the phase’s stop_flag. The scenario walker observes the global stop and terminates the whole run. Use when the predicate’s satisfaction is a precondition for any downstream phase being meaningful — e.g. ensure_compacted in the CQL sweep: if the table never reachessstables == 1, every subsequent query phase runs against an un-compacted table and produces meaningless results.
require: Vec<String>SRD-75 (C5) — strict-gate selectors. Each entry is a
metric()-style selector ("family, key=value, …") that MUST
resolve to a registered instrument within the gate’s grace
window (the first poll interval); an unresolved selector is a
hard poll_require error failing the phase. This is the
runtime guard for coordination gates whose until reads
another phase’s live metrics — an unregistered family reads
0.0 silently, so a typo’d selector otherwise passes the gate
instantly or hangs it to timeout. Deliberately poll-only:
stop_when’s lenient reads stay as SRD-83 sanctions them
(“family not yet present” is a legitimate not-yet state for a
stop predicate; for a gate it is a bug).