Exception: Smith::StepInProgressOnRestore
- Defined in:
- lib/smith/errors.rb
Overview
Raised on restore when the persisted payload has the step_in_progress marker set AND the workflow class opted into ‘idempotency_mode :strict`. Signals that a previous worker crashed between `persist!` (before advance) and `persist!` (after advance); the step’s effects are unknown, so blindly re-running could double-execute non-idempotent agent calls or tools.
Instance Attribute Summary collapse
-
#persistence_key ⇒ Object
readonly
Returns the value of attribute persistence_key.
-
#workflow ⇒ Object
readonly
Returns the value of attribute workflow.
Instance Method Summary collapse
-
#initialize(workflow:, persistence_key:) ⇒ StepInProgressOnRestore
constructor
A new instance of StepInProgressOnRestore.
Constructor Details
#initialize(workflow:, persistence_key:) ⇒ StepInProgressOnRestore
Returns a new instance of StepInProgressOnRestore.
149 150 151 152 153 154 155 156 157 158 |
# File 'lib/smith/errors.rb', line 149 def initialize(workflow:, persistence_key:) @workflow = workflow @persistence_key = persistence_key super( "step in progress on restore for #{workflow} key=#{persistence_key.inspect}: " \ "a previous worker crashed mid-step. Hosts using idempotency_mode :strict must " \ "decide whether to clear the persisted state (idempotent re-run unsafe) or " \ "switch to :lax (assume re-run is safe)." ) end |
Instance Attribute Details
#persistence_key ⇒ Object (readonly)
Returns the value of attribute persistence_key.
147 148 149 |
# File 'lib/smith/errors.rb', line 147 def persistence_key @persistence_key end |
#workflow ⇒ Object (readonly)
Returns the value of attribute workflow.
147 148 149 |
# File 'lib/smith/errors.rb', line 147 def workflow @workflow end |