Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return error if workflow backoff timer is not fired #7095

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions service/history/timer_queue_active_task_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,13 @@ func (t *timerQueueActiveTaskExecutor) executeWorkflowBackoffTimerTask(
if err != nil {
return err
}
if mutableState == nil || !mutableState.IsWorkflowExecutionRunning() {
return nil
if mutableState == nil {
release(nil)
return consts.ErrWorkflowExecutionNotFound
}
if !mutableState.IsWorkflowExecutionRunning() {
release(nil)
return consts.ErrWorkflowCompleted
}

// TODO: deprecated, remove below 3 metrics after v1.25
Expand Down Expand Up @@ -476,7 +481,8 @@ func (t *timerQueueActiveTaskExecutor) executeWorkflowBackoffTimerTask(

if mutableState.HadOrHasWorkflowTask() {
// already has workflow task
return nil
release(nil)
return errNoTimerFired
}

// schedule first workflow task
Expand Down
2 changes: 1 addition & 1 deletion service/history/timer_queue_active_task_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ func (s *timerQueueActiveTaskExecutorSuite) TestWorkflowBackoffTimer_Noop() {
s.mockExecutionMgr.EXPECT().GetWorkflowExecution(gomock.Any(), gomock.Any()).Return(&persistence.GetWorkflowExecutionResponse{State: persistenceMutableState}, nil)

resp := s.timerQueueActiveTaskExecutor.Execute(context.Background(), s.newTaskExecutable(timerTask))
s.NoError(resp.ExecutionErr)
s.ErrorIs(resp.ExecutionErr, errNoTimerFired)
}

func (s *timerQueueActiveTaskExecutorSuite) TestActivityRetryTimer_Fire() {
Expand Down
Loading