File tree Expand file tree Collapse file tree
endtoendtests/src/main/java/com/functions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414import com .microsoft .durabletask .azurefunctions .DurableClientContext ;
1515import com .microsoft .durabletask .azurefunctions .DurableClientInput ;
1616import com .microsoft .durabletask .azurefunctions .DurableOrchestrationTrigger ;
17+ import io .grpc .StatusRuntimeException ;
1718
1819import java .time .Duration ;
1920import java .util .Optional ;
@@ -99,9 +100,15 @@ public HttpResponseMessage startRewindNonFailedOrchestration(
99100 .build ();
100101 }
101102
102- // Attempt to rewind the non-failed orchestration using the client method
103- client .rewindInstance (instanceId , "Testing rewind on non-failed orchestration" );
104- context .getLogger ().info ("Rewind request sent for non-failed instance: " + instanceId );
103+ // Attempt to rewind the non-failed orchestration using the client method.
104+ // This is expected to be a no-op or may throw if the sidecar rejects it,
105+ // so we catch any exception and still return the check status response.
106+ try {
107+ client .rewindInstance (instanceId , "Testing rewind on non-failed orchestration" );
108+ context .getLogger ().info ("Rewind request sent for non-failed instance: " + instanceId );
109+ } catch (StatusRuntimeException e ) {
110+ context .getLogger ().info ("Rewind on non-failed instance was rejected (expected): " + e .getMessage ());
111+ }
105112
106113 return durableContext .createCheckStatusResponse (request , instanceId );
107114 }
You can’t perform that action at this time.
0 commit comments