Skip to content

Commit

Permalink
Return nil instead of task discarded error if namespace is invalid lo…
Browse files Browse the repository at this point in the history
…cally (#4678)

<!-- Describe what has changed in this PR -->
**What changed?**
* Return nil instead of task discarded error if namespace is invalid
locally

<!-- Tell your future self why have you made these changes -->
**Why?**
Returning task discarded error will make metrics confusing

<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
**How did you test it?**
N/A

<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
**Potential risks**
N/A

<!-- Is this PR a hotfix candidate or require that a notification be
sent to the broader community? (Yes/No) -->
**Is hotfix candidate?**
N/A
  • Loading branch information
wxing1292 authored and rodrigozhou committed Aug 7, 2023
1 parent a7832c7 commit 12c95dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions service/history/timerQueueStandbyTaskExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions service/history/transferQueueStandbyTaskExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 12c95dd

Please # to comment.