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

Fix errcheck in service/history #3754

Merged
merged 1 commit into from Dec 23, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions service/history/queues/queue_base_test.go
Expand Up @@ -295,7 +295,7 @@ func (s *queueBaseSuite) TestStartStop() {

s.mockRescheduler.EXPECT().Start().Times(1)
base.Start()
base.processNewRange()
s.NoError(base.processNewRange())

<-doneCh
<-base.checkpointTimer.C
Expand Down Expand Up @@ -344,7 +344,7 @@ func (s *queueBaseSuite) TestProcessNewRange() {
)
s.True(base.nonReadableScope.Range.Equals(NewRange(tasks.MinimumKey, tasks.MaximumKey)))

base.processNewRange()
s.NoError(base.processNewRange())
defaultReader, ok := base.readerGroup.ReaderByID(DefaultReaderId)
s.True(ok)
scopes := defaultReader.Scopes()
Expand Down
8 changes: 6 additions & 2 deletions service/history/queues/queue_immediate.go
Expand Up @@ -157,7 +157,9 @@ func (p *immediateQueue) processEventLoop() {
case <-p.shutdownCh:
return
case <-p.notifyCh:
p.processNewRange()
if err := p.processNewRange(); err != nil {
p.logger.Error("Unable to process new range", tag.Error(err))
}
case <-pollTimer.C:
p.processPollTimer(pollTimer)
case <-p.checkpointTimer.C:
Expand All @@ -169,7 +171,9 @@ func (p *immediateQueue) processEventLoop() {
}

func (p *immediateQueue) processPollTimer(pollTimer *time.Timer) {
p.processNewRange()
if err := p.processNewRange(); err != nil {
p.logger.Error("Unable to process new range", tag.Error(err))
}

pollTimer.Reset(backoff.JitDuration(
p.options.MaxPollInterval(),
Expand Down
4 changes: 2 additions & 2 deletions service/history/workflowTaskHandlerCallbacks_test.go
Expand Up @@ -197,10 +197,10 @@ func (s *WorkflowTaskHandlerCallbackSuite) TestVerifyFirstWorkflowTaskScheduled_
}, "wType", "testTaskQueue", payloads.EncodeString("input"), 25*time.Second, 20*time.Second, 200*time.Second, "identity")

// zombie state should be treated as open
ms.UpdateWorkflowStateStatus(
s.NoError(ms.UpdateWorkflowStateStatus(
enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE,
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
)
))
wfMs := workflow.TestCloneToProto(ms)
gwmsResponse := &persistence.GetWorkflowExecutionResponse{State: wfMs}
s.mockExecutionMgr.EXPECT().GetWorkflowExecution(gomock.Any(), gomock.Any()).Return(gwmsResponse, nil)
Expand Down