Skip to content

Commit 6f0cf07

Browse files
authored
Fix timeout during operation retry (#2221)
1 parent 21d15ae commit 6f0cf07

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

temporal-test-server/src/main/java/io/temporal/internal/testservice/StateMachines.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,12 @@ private static void timeoutNexusOperation(
789789
private static State failNexusOperation(
790790
RequestContext ctx, NexusOperationData data, Failure failure, long notUsed) {
791791
RetryState retryState = attemptNexusOperationRetry(ctx, Optional.of(failure), data);
792-
if (retryState == RetryState.RETRY_STATE_IN_PROGRESS) {
792+
if (retryState == RetryState.RETRY_STATE_IN_PROGRESS
793+
|| retryState == RetryState.RETRY_STATE_TIMEOUT) {
794+
// RETRY_STATE_TIMEOUT indicates that the next attempt schedule time would exceed the
795+
// operation's schedule-to-close timeout, so do not fail the operation here and allow
796+
// it to be timed out by the timer set in
797+
// io.temporal.internal.testservice.TestWorkflowMutableStateImpl.timeoutNexusOperation
793798
return (Strings.isNullOrEmpty(data.operationId)) ? INITIATED : STARTED;
794799
}
795800

0 commit comments

Comments
 (0)