Skip to content

Commit

Permalink
Removing target-domain-not-active special-case handling (uber#4835)
Browse files Browse the repository at this point in the history
The suspicion is that this is not actually a transient and retriable
error, so this should be handled differently
  • Loading branch information
davidporter-id-au authored May 19, 2022
1 parent a575908 commit beab75c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 44 deletions.
8 changes: 4 additions & 4 deletions service/history/task/transfer_active_task_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,11 @@ func (t *transferActiveTaskExecutor) processCancelExecution(
targetDomainName,
requestCancelInfo.CancelRequestID,
); err != nil {
t.logger.Debug(fmt.Sprintf("Failed to cancel external workflow execution. Error: %v", err))
t.logger.Info(fmt.Sprintf("Failed to cancel external workflow execution. Error: %v", err))

// Check to see if the error is non-transient, in which case add RequestCancelFailed
// event and complete transfer task by setting the err = nil
if common.IsServiceTransientError(err) || common.IsContextTimeoutError(err) || err == errTargetDomainNotActive {
if common.IsServiceTransientError(err) || common.IsContextTimeoutError(err) {
// for retryable error just return
return err
}
Expand Down Expand Up @@ -694,11 +694,11 @@ func (t *transferActiveTaskExecutor) processSignalExecution(
targetDomainName,
signalInfo,
); err != nil {
t.logger.Debug(fmt.Sprintf("Failed to signal external workflow execution. Error: %v", err))
t.logger.Info(fmt.Sprintf("Failed to signal external workflow execution. Error: %v", err))

// Check to see if the error is non-transient, in which case add SignalFailed
// event and complete transfer task by setting the err = nil
if common.IsServiceTransientError(err) || common.IsContextTimeoutError(err) || err == errTargetDomainNotActive {
if common.IsServiceTransientError(err) || common.IsContextTimeoutError(err) {
// for retryable error just return
return err
}
Expand Down
40 changes: 0 additions & 40 deletions service/history/task/transfer_active_task_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,26 +974,6 @@ func (s *transferActiveTaskExecutorSuite) TestProcessCancelExecution_CrossCluste
)
}

func (s *transferActiveTaskExecutorSuite) TestProcessCancelExecution_TargetNotActive() {
s.testProcessCancelExecutionWithError(
s.targetDomainID,
func(
mutableState execution.MutableState,
workflowExecution, targetExecution types.WorkflowExecution,
event *types.HistoryEvent,
transferTask Task,
requestCancelInfo *persistence.RequestCancelInfo,
) {
persistenceMutableState, err := test.CreatePersistenceMutableState(mutableState, event.ID, event.Version)
s.NoError(err)
s.mockExecutionMgr.On("GetWorkflowExecution", mock.Anything, mock.Anything).Return(&persistence.GetWorkflowExecutionResponse{State: persistenceMutableState}, nil)
cancelRequest := createTestRequestCancelWorkflowExecutionRequest(s.targetDomainName, transferTask.GetInfo().(*persistence.TransferTaskInfo), requestCancelInfo.CancelRequestID)
s.mockHistoryClient.EXPECT().RequestCancelWorkflowExecution(gomock.Any(), cancelRequest).Return(&types.DomainNotActiveError{}).Times(1)
},
errTargetDomainNotActive,
)
}

func (s *transferActiveTaskExecutorSuite) testProcessCancelExecution(
targetDomainID string,
setupMockFn func(
Expand Down Expand Up @@ -1106,26 +1086,6 @@ func (s *transferActiveTaskExecutorSuite) TestProcessSignalExecution_Failure() {
)
}

func (s *transferActiveTaskExecutorSuite) TestProcessSignalExecution_TargetNotActive() {
s.testProcessSignalExecutionWithError(
s.targetDomainID,
func(
mutableState execution.MutableState,
workflowExecution, targetExecution types.WorkflowExecution,
event *types.HistoryEvent,
transferTask Task,
signalInfo *persistence.SignalInfo,
) {
persistenceMutableState, err := test.CreatePersistenceMutableState(mutableState, event.ID, event.Version)
s.NoError(err)
s.mockExecutionMgr.On("GetWorkflowExecution", mock.Anything, mock.Anything).Return(&persistence.GetWorkflowExecutionResponse{State: persistenceMutableState}, nil)
signalRequest := createTestSignalWorkflowExecutionRequest(s.targetDomainName, transferTask.GetInfo().(*persistence.TransferTaskInfo), signalInfo)
s.mockHistoryClient.EXPECT().SignalWorkflowExecution(gomock.Any(), signalRequest).Return(&types.DomainNotActiveError{}).Times(1)
},
errTargetDomainNotActive,
)
}

func (s *transferActiveTaskExecutorSuite) TestProcessSignalExecution_Duplication() {
s.testProcessSignalExecution(
s.targetDomainID,
Expand Down

0 comments on commit beab75c

Please sign in to comment.