My CI runs runReplayHistory
on every PR.
I have a workflow with an await condition()
, and I want to add a timeout to it to prevent the workflow from running forever in case my “Done” signal never comes back.
Workflow (and replay histories) was working just fine. But as soon as I add a timeout, CI fails 'cause runReplayHistory
accuses non-deterministic behavior. The error I get:
2024-12-06T21:45:15.170900Z WARN temporal_sdk_core::worker::workflow: Failing workflow task run_id=37fdda9b-d084-4cdc-9b8d-d1460dde5c01 failure=Failure { failure: Some(Failure { message: "[TMPRL1100] Nondeterminism error:
Timer machine does not handle this event: HistoryEvent(id: 21, Ok(ActivityTaskScheduled))", source: "", stack_trace: "", encoded_attributes: None, cause: None, failure_info: Some(ApplicationFailureInfo(ApplicationFailureInfo { r#type: "", non_retryable: false, details: None, next_retry_delay: None })) }), force_cause: NonDeterministicError }
Unhandled rejection { runId: undefined } DeterminismViolationError: Replay failed with a nondeterminism error. This means that the workflow code as written is not compatible with the history that was fed in. Details: Workflow activation completion failed: Failure { failure: Some(Failure { message: "[TMPRL1100] Nondeterminism error:
Timer machine does not handle this event: HistoryEvent(id: 21, Ok(ActivityTaskScheduled))", source: "", stack_trace: "", encoded_attributes: None, cause: None, failure_info: Some(ApplicationFailureInfo(ApplicationFailureInfo { r#type: "", non_retryable: false, details: None, next_retry_delay: None })) }), force_cause: NonDeterministicError }
See the diff. Left-side is the working version, right-side is the version accusing non-determinism.
Any ideas why these changes make my workflow non-deterministic now? At first I thought it’d be the timeout, but now I wonder if it’s the if()
block that checks for generationStatus (line 46).
Thanks in advance.