From 49b65e476fc000c4882e52c885f154ebb9738c49 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 13 Feb 2026 11:09:55 -0800 Subject: [PATCH] Add worker_poll_complete_on_shutdown namespace capability This capability indicates whether the server supports server-side completion of outstanding worker polls on shutdown. When enabled, the server will complete polls for workers that send WorkerInstanceKey in their poll requests and call ShutdownWorker with the same key. --- openapi/openapiv2.json | 4 ++++ openapi/openapiv3.yaml | 8 ++++++++ temporal/api/namespace/v1/message.proto | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 85e36caa2..2f21bedcc 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -13670,6 +13670,10 @@ "standaloneActivities": { "type": "boolean", "title": "True if the namespace supports standalone activities" + }, + "workerPollCompleteOnShutdown": { + "type": "boolean", + "description": "True if the namespace supports server-side completion of outstanding worker polls on shutdown.\nWhen enabled, the server will complete polls for workers that send WorkerInstanceKey in their\npoll requests and call ShutdownWorker with the same WorkerInstanceKey. The poll will return\nan empty response. When this flag is true, workers should allow polls to return gracefully\nrather than terminating any open polls on shutdown." } }, "description": "Namespace capability details. Should contain what features are enabled in a namespace." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 058b71005..c220f6773 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10744,6 +10744,14 @@ components: standaloneActivities: type: boolean description: True if the namespace supports standalone activities + workerPollCompleteOnShutdown: + type: boolean + description: |- + True if the namespace supports server-side completion of outstanding worker polls on shutdown. + When enabled, the server will complete polls for workers that send WorkerInstanceKey in their + poll requests and call ShutdownWorker with the same WorkerInstanceKey. The poll will return + an empty response. When this flag is true, workers should allow polls to return gracefully + rather than terminating any open polls on shutdown. description: Namespace capability details. Should contain what features are enabled in a namespace. NamespaceInfo_Limits: type: object diff --git a/temporal/api/namespace/v1/message.proto b/temporal/api/namespace/v1/message.proto index b6f5c4cda..9f52e3452 100644 --- a/temporal/api/namespace/v1/message.proto +++ b/temporal/api/namespace/v1/message.proto @@ -42,6 +42,12 @@ message NamespaceInfo { bool workflow_pause = 6; // True if the namespace supports standalone activities bool standalone_activities = 7; + // True if the namespace supports server-side completion of outstanding worker polls on shutdown. + // When enabled, the server will complete polls for workers that send WorkerInstanceKey in their + // poll requests and call ShutdownWorker with the same WorkerInstanceKey. The poll will return + // an empty response. When this flag is true, workers should allow polls to return gracefully + // rather than terminating any open polls on shutdown. + bool worker_poll_complete_on_shutdown = 8; } // Namespace configured limits