Class StepIndeterminateException

All Implemented Interfaces:
Serializable

public class StepIndeterminateException extends StepFailedException
Exception used as the failure cause when a step's action was in-flight at a crash and, under the engine's at-most-once execution guarantee, is not re-run on recovery.

A step's external side effect runs before its COMPLETED event commits. If the worker crashes in that window, the durable STARTED record survives but the action's result does not, and the engine cannot tell whether the side effect completed. Re-running it would make the effect run twice (at-least-once); to keep effects at-most-once the engine refuses to re-run the attempt and instead resolves the step through the regular error flow with this cause — its outcome is indeterminate (the effect ran zero or one times). For a step without a retry policy this surfaces as a FAILED step; with a retry policy it surfaces as a RETRYING attempt.

A subtype of StepFailedException: callers that want to handle any step-level failure can catch the parent; callers that need to distinguish "in-flight at a crash, not re-run" specifically can catch this type. Distinct from StepTimedOutException (the step exceeded its timeout) and StepCancellationException (explicit cancellation): here the action was deliberately not re-executed to preserve the at-most-once guarantee.

Since:
5.4.0
Author:
Stefan Dragisic
See Also:
  • Constructor Details

    • StepIndeterminateException

      public StepIndeterminateException(String stepName)
      Constructs a StepIndeterminateException for the given step.
      Parameters:
      stepName - the step whose in-flight attempt was interrupted by a crash and not re-run
    • StepIndeterminateException

      public StepIndeterminateException(String message, @Nullable Throwable cause)
      Constructs a StepIndeterminateException with a custom message.
      Parameters:
      message - the detail message describing the indeterminate step
      cause - the underlying cause, or null if none