Skip to content

Commit

Permalink
[history] more cautious in deciding domain state to make decisions on…
Browse files Browse the repository at this point in the history
… dropping queued tasks (#5164)

What changed?

When domain cache returned entity not found error, don't drop queued tasks to be more conservative.

Why?

In cases when the cache is dubious, we shouldn't drop the queued tasks.
  • Loading branch information
shijiesheng authored and Groxx committed Mar 17, 2023
1 parent 2e9add0 commit 8e81044
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions service/history/queue/task_allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ func (t *taskAllocatorImpl) Unlock() {
func isDomainNotRegistered(shard shard.Context, domainID string) (bool, error) {
domainEntry, err := shard.GetDomainCache().GetDomainByID(domainID)
if err != nil {
if _, ok := err.(*types.EntityNotExistsError); ok {
return true, nil
}
// unexpected error in finding a domain
// error in finding a domain
return false, err
}
info := domainEntry.GetInfo()
Expand Down

0 comments on commit 8e81044

Please sign in to comment.