Skip to content

Commit

Permalink
Fix unbalanced locks in test server for Nexus
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns committed Dec 3, 2024
1 parent 8782de3 commit a1b031d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import io.temporal.internal.testservice.StateMachines.ActivityTaskData;
import io.temporal.internal.testservice.StateMachines.CancelExternalData;
import io.temporal.internal.testservice.StateMachines.ChildWorkflowData;
import io.temporal.internal.testservice.StateMachines.NexusOperationData;
import io.temporal.internal.testservice.StateMachines.SignalExternalData;
import io.temporal.internal.testservice.StateMachines.State;
import io.temporal.internal.testservice.StateMachines.TimerData;
Expand Down Expand Up @@ -782,11 +783,11 @@ private void processScheduleNexusOperation(
nexusOperations.put(scheduleEventId, operation);

operation.action(Action.INITIATE, ctx, attr, workflowTaskCompletedId);
// Record the current attempt of this
int attempt = operation.getData().getAttempt();
ctx.addTimer(
ProtobufTimeUtils.toJavaDuration(operation.getData().requestTimeout),
() ->
timeoutNexusRequest(
scheduleEventId, "StartNexusOperation", operation.getData().getAttempt()),
() -> timeoutNexusRequest(scheduleEventId, "StartNexusOperation", attempt),
"StartNexusOperation request timeout");
if (attr.hasScheduleToCloseTimeout()
&& Durations.toMillis(attr.getScheduleToCloseTimeout()) > 0) {
Expand Down

0 comments on commit a1b031d

Please sign in to comment.