diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index dfaa2618c..494e42587 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -15355,6 +15355,10 @@ "pollerScalingDecision": { "$ref": "#/definitions/v1PollerScalingDecision", "description": "Server-advised information the SDK may use to adjust its poller count." + }, + "completedByWorkerShutdown": { + "type": "boolean", + "description": "When true, this empty response was caused by the server completing the poll\nbecause the worker has been shut down via the ShutdownWorker API. The SDK\nshould stop polling on this task queue.\n" } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index fe637190c..823bcc1f4 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -12220,6 +12220,15 @@ components: allOf: - $ref: '#/components/schemas/PollerScalingDecision' description: Server-advised information the SDK may use to adjust its poller count. + completedByWorkerShutdown: + type: boolean + description: |- + When true, this empty response was caused by the server completing the poll + because the worker has been shut down via the ShutdownWorker API. The SDK + should stop polling on this task queue. + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "by" describes the cause of poll completion. --) PollerInfo: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 8580b7179..ceff6166f 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -338,6 +338,13 @@ message PollWorkflowTaskQueueResponse { repeated temporal.api.protocol.v1.Message messages = 15; // Server-advised information the SDK may use to adjust its poller count. temporal.api.taskqueue.v1.PollerScalingDecision poller_scaling_decision = 16; + // When true, this empty response was caused by the server completing the poll + // because the worker has been shut down via the ShutdownWorker API. The SDK + // should stop polling on this task queue. + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "by" describes the cause of poll completion. --) + bool completed_by_worker_shutdown = 17; } message RespondWorkflowTaskCompletedRequest { @@ -536,6 +543,13 @@ message PollActivityTaskQueueResponse { temporal.api.common.v1.Priority priority = 19; // The run ID of the activity execution, only set for standalone activities. string activity_run_id = 20; + // When true, this empty response was caused by the server completing the poll + // because the worker has been shut down via the ShutdownWorker API. The SDK + // should stop polling on this task queue. + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "by" describes the cause of poll completion. --) + bool completed_by_worker_shutdown = 21; } message RecordActivityTaskHeartbeatRequest { @@ -1923,6 +1937,13 @@ message PollNexusTaskQueueResponse { temporal.api.nexus.v1.Request request = 2; // Server-advised information the SDK may use to adjust its poller count. temporal.api.taskqueue.v1.PollerScalingDecision poller_scaling_decision = 3; + // When true, this empty response was caused by the server completing the poll + // because the worker has been shut down via the ShutdownWorker API. The SDK + // should stop polling on this task queue. + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "by" describes the cause of poll completion. --) + bool completed_by_worker_shutdown = 4; } message RespondNexusTaskCompletedRequest {