Skip to content

Commit b66af7a

Browse files
authored
Add worker_poll_complete_on_shutdown namespace capability (#719)
## What Changed Adds a new namespace capability `worker_poll_complete_on_shutdown` to indicate whether the server supports server-side completion of outstanding worker polls on shutdown. ## Why When this capability is enabled, the server will complete polls for workers that: 1. Send `WorkerInstanceKey` in their poll requests 2. Call `ShutdownWorker` with the same `WorkerInstanceKey` SDKs can check this capability via `DescribeNamespace` to decide whether to rely on server-side poll completion or handle it client-side. ## How - Added `bool worker_poll_complete_on_shutdown = 8` to `NamespaceInfo.Capabilities` message in `namespace/v1/message.proto` ## Related PRs - Server: temporalio/temporal#9323
1 parent ff14265 commit b66af7a

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

openapi/openapiv2.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13670,6 +13670,10 @@
1367013670
"standaloneActivities": {
1367113671
"type": "boolean",
1367213672
"title": "True if the namespace supports standalone activities"
13673+
},
13674+
"workerPollCompleteOnShutdown": {
13675+
"type": "boolean",
13676+
"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."
1367313677
}
1367413678
},
1367513679
"description": "Namespace capability details. Should contain what features are enabled in a namespace."

openapi/openapiv3.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10744,6 +10744,14 @@ components:
1074410744
standaloneActivities:
1074510745
type: boolean
1074610746
description: True if the namespace supports standalone activities
10747+
workerPollCompleteOnShutdown:
10748+
type: boolean
10749+
description: |-
10750+
True if the namespace supports server-side completion of outstanding worker polls on shutdown.
10751+
When enabled, the server will complete polls for workers that send WorkerInstanceKey in their
10752+
poll requests and call ShutdownWorker with the same WorkerInstanceKey. The poll will return
10753+
an empty response. When this flag is true, workers should allow polls to return gracefully
10754+
rather than terminating any open polls on shutdown.
1074710755
description: Namespace capability details. Should contain what features are enabled in a namespace.
1074810756
NamespaceInfo_Limits:
1074910757
type: object

temporal/api/namespace/v1/message.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ message NamespaceInfo {
4242
bool workflow_pause = 6;
4343
// True if the namespace supports standalone activities
4444
bool standalone_activities = 7;
45+
// True if the namespace supports server-side completion of outstanding worker polls on shutdown.
46+
// When enabled, the server will complete polls for workers that send WorkerInstanceKey in their
47+
// poll requests and call ShutdownWorker with the same WorkerInstanceKey. The poll will return
48+
// an empty response. When this flag is true, workers should allow polls to return gracefully
49+
// rather than terminating any open polls on shutdown.
50+
bool worker_poll_complete_on_shutdown = 8;
4551
}
4652

4753
// Namespace configured limits

0 commit comments

Comments
 (0)