Skip to content

Commit c9726cb

Browse files
committed
Add shutdown_worker_rejected field to poll responses
Add a bool field to PollWorkflowTaskQueueResponse, PollActivityTaskQueueResponse, and PollNexusTaskQueueResponse to indicate when an empty poll response was caused by the server rejecting the poll because the worker has been shut down via the ShutdownWorker API. Made-with: Cursor
1 parent 54414e1 commit c9726cb

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

openapi/openapiv2.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14580,6 +14580,10 @@
1458014580
"pollerScalingDecision": {
1458114581
"$ref": "#/definitions/v1PollerScalingDecision",
1458214582
"description": "Server-advised information the SDK may use to adjust its poller count."
14583+
},
14584+
"shutdownWorkerRejected": {
14585+
"type": "boolean",
14586+
"description": "When true, this empty response was caused by the server rejecting the poll\nbecause the worker has been shut down via the ShutdownWorker API. The SDK\nshould stop polling on this task queue."
1458314587
}
1458414588
}
1458514589
},

openapi/openapiv3.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11640,6 +11640,12 @@ components:
1164011640
allOf:
1164111641
- $ref: '#/components/schemas/PollerScalingDecision'
1164211642
description: Server-advised information the SDK may use to adjust its poller count.
11643+
shutdownWorkerRejected:
11644+
type: boolean
11645+
description: |-
11646+
When true, this empty response was caused by the server rejecting the poll
11647+
because the worker has been shut down via the ShutdownWorker API. The SDK
11648+
should stop polling on this task queue.
1164311649
PollerInfo:
1164411650
type: object
1164511651
properties:

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ message PollWorkflowTaskQueueResponse {
331331
repeated temporal.api.protocol.v1.Message messages = 15;
332332
// Server-advised information the SDK may use to adjust its poller count.
333333
temporal.api.taskqueue.v1.PollerScalingDecision poller_scaling_decision = 16;
334+
// When true, this empty response was caused by the server rejecting the poll
335+
// because the worker has been shut down via the ShutdownWorker API. The SDK
336+
// should stop polling on this task queue.
337+
bool shutdown_worker_rejected = 17;
334338
}
335339

336340
message RespondWorkflowTaskCompletedRequest {
@@ -516,6 +520,10 @@ message PollActivityTaskQueueResponse {
516520
temporal.api.common.v1.Priority priority = 19;
517521
// The run ID of the activity execution, only set for standalone activities.
518522
string activity_run_id = 20;
523+
// When true, this empty response was caused by the server rejecting the poll
524+
// because the worker has been shut down via the ShutdownWorker API. The SDK
525+
// should stop polling on this task queue.
526+
bool shutdown_worker_rejected = 21;
519527
}
520528

521529
message RecordActivityTaskHeartbeatRequest {
@@ -1892,6 +1900,10 @@ message PollNexusTaskQueueResponse {
18921900
temporal.api.nexus.v1.Request request = 2;
18931901
// Server-advised information the SDK may use to adjust its poller count.
18941902
temporal.api.taskqueue.v1.PollerScalingDecision poller_scaling_decision = 3;
1903+
// When true, this empty response was caused by the server rejecting the poll
1904+
// because the worker has been shut down via the ShutdownWorker API. The SDK
1905+
// should stop polling on this task queue.
1906+
bool shutdown_worker_rejected = 4;
18951907
}
18961908

18971909
message RespondNexusTaskCompletedRequest {

0 commit comments

Comments
 (0)