From 12c95ddf04b1d22697a58fe3cfd08d22bcefe773 Mon Sep 17 00:00:00 2001 From: wxing1292 Date: Tue, 25 Jul 2023 13:35:29 -0700 Subject: [PATCH] Return nil instead of task discarded error if namespace is invalid locally (#4678) **What changed?** * Return nil instead of task discarded error if namespace is invalid locally **Why?** Returning task discarded error will make metrics confusing **How did you test it?** N/A **Potential risks** N/A **Is hotfix candidate?** N/A --- service/history/timerQueueStandbyTaskExecutor.go | 4 ++-- service/history/transferQueueStandbyTaskExecutor.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/service/history/timerQueueStandbyTaskExecutor.go b/service/history/timerQueueStandbyTaskExecutor.go index 647db8dbf4e..82a8f949888 100644 --- a/service/history/timerQueueStandbyTaskExecutor.go +++ b/service/history/timerQueueStandbyTaskExecutor.go @@ -440,8 +440,8 @@ func (t *timerQueueStandbyTaskExecutor) processTimer( return err } if !nsRecord.IsOnCluster(t.clusterName) { - // discard standby tasks - return consts.ErrTaskDiscarded + // namespace is not replicated to local cluster, ignore corresponding tasks + return nil } executionContext, release, err := getWorkflowExecutionContextForTask(ctx, t.cache, timerTask) diff --git a/service/history/transferQueueStandbyTaskExecutor.go b/service/history/transferQueueStandbyTaskExecutor.go index 94b8ac0896a..77ee9a7176f 100644 --- a/service/history/transferQueueStandbyTaskExecutor.go +++ b/service/history/transferQueueStandbyTaskExecutor.go @@ -508,8 +508,8 @@ func (t *transferQueueStandbyTaskExecutor) processTransfer( return err } if !nsRecord.IsOnCluster(t.clusterName) { - // discard standby tasks - return consts.ErrTaskDiscarded + // namespace is not replicated to local cluster, ignore corresponding tasks + return nil } weContext, release, err := getWorkflowExecutionContextForTask(ctx, t.cache, taskInfo)