From b335f6e1499b5dc8083200a05ce92992b93c5320 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 3 Apr 2026 11:32:20 -0700 Subject: [PATCH 1/2] Log when rejecting poll from recently-shutdown worker The shutdown-worker cache silently returns errNoTasks, making it indistinguishable from a normal empty poll. Add an Info log so operators can tell when zombie re-polls are being rejected. Co-Authored-By: Claude Opus 4.6 --- service/matching/matching_engine.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/service/matching/matching_engine.go b/service/matching/matching_engine.go index 58e6b83f2f7..659939c105d 100644 --- a/service/matching/matching_engine.go +++ b/service/matching/matching_engine.go @@ -2854,6 +2854,10 @@ func (e *matchingEngineImpl) pollTask( // returned to the handler before a context timeout error is generated. workerInstanceKey := pollMetadata.workerInstanceKey if workerInstanceKey != "" && e.shutdownWorkers.Get(workerInstanceKey) != nil { + e.logger.Info("Rejecting poll from recently-shutdown worker", + tag.WorkflowTaskQueueName(partition.TaskQueue().Name()), + tag.NewStringTag("worker-instance-key", workerInstanceKey), + ) return nil, false, errNoTasks } From e49af06bed794d34b39072e7979cf249bab08485 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Mon, 6 Apr 2026 18:22:15 -0700 Subject: [PATCH 2/2] Add namespace ID and task queue type tags to shutdown rejection log Co-Authored-By: Claude Opus 4.6 --- service/matching/matching_engine.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/matching/matching_engine.go b/service/matching/matching_engine.go index 444c8944d4b..feb1b40de13 100644 --- a/service/matching/matching_engine.go +++ b/service/matching/matching_engine.go @@ -2860,7 +2860,9 @@ func (e *matchingEngineImpl) pollTask( workerInstanceKey := pollMetadata.workerInstanceKey if workerInstanceKey != "" && e.shutdownWorkers.Get(workerInstanceKey) != nil { e.logger.Info("Rejecting poll from recently-shutdown worker", + tag.WorkflowNamespaceID(partition.NamespaceId()), tag.WorkflowTaskQueueName(partition.TaskQueue().Name()), + tag.WorkflowTaskQueueType(partition.TaskType()), tag.NewStringTag("worker-instance-key", workerInstanceKey), ) return nil, false, errNoTasks