Skip to main content

PhasePollSpec

Struct PhasePollSpec 

Source
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: String

Polydat 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 — calls session_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 reaches sstables == 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).

Trait Implementations§

Source§

impl Clone for PhasePollSpec

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PhasePollSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PhasePollSpec

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PhasePollSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PhasePollSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.