Skip to content

Commit

Permalink
revert unblock UseExisting
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigozhou committed Mar 4, 2025
1 parent a507b5e commit e3ae76a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@

import com.google.common.base.Defaults;
import io.nexusrpc.Header;
import io.nexusrpc.handler.HandlerException;
import io.nexusrpc.handler.ServiceImplInstance;
import io.temporal.api.common.v1.Callback;
import io.temporal.api.enums.v1.TaskQueueKind;
import io.temporal.api.enums.v1.WorkflowIdConflictPolicy;
import io.temporal.api.taskqueue.v1.TaskQueue;
import io.temporal.client.OnConflictOptions;
import io.temporal.client.WorkflowOptions;
Expand All @@ -35,6 +37,7 @@
import io.temporal.internal.client.NexusStartWorkflowRequest;
import java.util.Arrays;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;
import java.util.stream.Collectors;
import org.slf4j.Logger;
Expand Down Expand Up @@ -152,6 +155,16 @@ public static WorkflowStub createNexusBoundStub(
.setAttachCompletionCallbacks(true)
.build());

// TODO(klassenq) temporarily blocking conflict policy USE_EXISTING.
if (Objects.equals(
WorkflowIdConflictPolicy.WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING,
options.getWorkflowIdConflictPolicy())) {
throw new HandlerException(
HandlerException.ErrorType.INTERNAL,
new IllegalArgumentException(
"Workflow ID conflict policy UseExisting is not supported for Nexus WorkflowRunOperation."),
HandlerException.RetryBehavior.NON_RETRYABLE);
}
return stub.newInstance(nexusWorkflowOptions.build());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.UUID;
import org.junit.*;

@Ignore("Skipping until we can support USE_EXISTING")
public class WorkflowHandleUseExistingOnConflictCancelTest {
@Rule
public SDKTestWorkflowRule testWorkflowRule =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.UUID;
import org.junit.*;

@Ignore("Skipping until we can support USE_EXISTING")
public class WorkflowHandleUseExistingOnConflictTest {
@Rule
public SDKTestWorkflowRule testWorkflowRule =
Expand Down

0 comments on commit e3ae76a

Please sign in to comment.