Skip to content

Commit 99efa1b

Browse files
authored
Fix ResetStickyTaskList call (#541)
1 parent 2da954b commit 99efa1b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

evictiontest/workflow_cache_eviction_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (s *CacheEvictionSuite) TestResetStickyOnEviction() {
164164
// this is the critical point of the test.
165165
// ResetSticky should be called exactly once because our workflow cache evicts when full
166166
// so if our worker puts *cacheSize* entries in the cache, it should evict exactly one
167-
s.service.EXPECT().ResetStickyTaskList(gomock.Any(), gomock.Any()).DoAndReturn(mockResetStickyTaskList).Times(1)
167+
s.service.EXPECT().ResetStickyTaskList(gomock.Any(), gomock.Any(), callOptions...).DoAndReturn(mockResetStickyTaskList).Times(1)
168168

169169
workflowWorker := internal.NewWorker(s.service, "test-domain", "tasklist", worker.Options{DisableActivityWorker: true})
170170

internal/internal_task_pollers.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,17 @@ func (wtp *workflowTaskPoller) processWorkflowTask(workflowTask *workflowTask) e
256256
}
257257

258258
func (wtp *workflowTaskPoller) processResetStickinessTask(rst *resetStickinessTask) error {
259-
_, err := wtp.service.ResetStickyTaskList(context.Background(), rst.task)
260-
return err
259+
tchCtx, cancel, opt := newChannelContext(context.Background())
260+
defer cancel()
261+
if _, err := wtp.service.ResetStickyTaskList(tchCtx, rst.task, opt...); err != nil {
262+
wtp.logger.Warn("ResetStickyTaskList failed",
263+
zap.String(tagWorkflowID, rst.task.Execution.GetWorkflowId()),
264+
zap.String(tagRunID, rst.task.Execution.GetRunId()),
265+
zap.Error(err))
266+
return err
267+
}
268+
269+
return nil
261270
}
262271

263272
func (wtp *workflowTaskPoller) scheduleRespondDecisionTaskCompleted(wc WorkflowExecutionContext, workflowTask *workflowTask, startTime time.Time) {

0 commit comments

Comments
 (0)