Skip to content

Commit a1b031d

Browse files
Fix unbalanced locks in test server for Nexus
1 parent 8782de3 commit a1b031d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
import io.temporal.internal.testservice.StateMachines.ActivityTaskData;
6363
import io.temporal.internal.testservice.StateMachines.CancelExternalData;
6464
import io.temporal.internal.testservice.StateMachines.ChildWorkflowData;
65+
import io.temporal.internal.testservice.StateMachines.NexusOperationData;
6566
import io.temporal.internal.testservice.StateMachines.SignalExternalData;
6667
import io.temporal.internal.testservice.StateMachines.State;
6768
import io.temporal.internal.testservice.StateMachines.TimerData;
@@ -782,11 +783,11 @@ private void processScheduleNexusOperation(
782783
nexusOperations.put(scheduleEventId, operation);
783784

784785
operation.action(Action.INITIATE, ctx, attr, workflowTaskCompletedId);
786+
// Record the current attempt of this
787+
int attempt = operation.getData().getAttempt();
785788
ctx.addTimer(
786789
ProtobufTimeUtils.toJavaDuration(operation.getData().requestTimeout),
787-
() ->
788-
timeoutNexusRequest(
789-
scheduleEventId, "StartNexusOperation", operation.getData().getAttempt()),
790+
() -> timeoutNexusRequest(scheduleEventId, "StartNexusOperation", attempt),
790791
"StartNexusOperation request timeout");
791792
if (attr.hasScheduleToCloseTimeout()
792793
&& Durations.toMillis(attr.getScheduleToCloseTimeout()) > 0) {

0 commit comments

Comments
 (0)