When we have a timer, can NDE occur if we increase/decrease the timer duration? Perhaps previously it is not timed out but then it times out in the newer version, or vice versa. If it is timed out, it will execute activity A. The selector is also waiting for a signal.
Can adding, removing, or reordering workflow.UpsertSearchAttributes(ctx, attributes) cause NDE?
Previously, timer is triggered every 00.00. In the new version, I include a variable TestFlag (from environment variable) to determine the timer duration value, whether it is 00.00 or x minutes (from environment variable). If it is timed out, it will execute activity A. The selector is also waiting for a signal. Can the addition of the flag cause NDE?
workflow.UpsertSearchAttributes(ctx, attributes) generates a command entry in workflow event history and changing the order will cause non-determinism. We recently faced some issue due to this.
IIUC, changing the timer value itself shouldn’t cause NDE. The workflow which went to sleep before the timer duration change will honour the sleep duration specified early on and wake up after that. The newer workflow executions which goes to sleep post time value change will honour the newer timer duration.
You can check the code that compares workflow commands here.
However, better to get confirmation from folks from the temporal team on this.