From f91b78e30f8dd18f2bf32a3c3993caf8c7ecffa8 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Thu, 12 Jun 2025 10:25:30 -0700 Subject: [PATCH 01/18] _**READ BEFORE MERGING:** All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted._ **What changed?** + Boolean field added to DescribeTaskQueue request to control sending task queue config in the response. + New messages for RateLimit and TaskQueueConfig + UpdateTaskQueueConfig api implementation: Created a UpdateTaskQueueConfigRequest and UpdateTaskQueueConfigResponse. **Why?** Server needs an API endpoint for update TaskQueue RateLimits. **Breaking changes** Yes. New Api's are breaking changes **Server PR** None at the moment. --- openapi/openapiv2.json | 218 ++++++++++++++++++ openapi/openapiv3.yaml | 189 +++++++++++++++ temporal/api/taskqueue/v1/message.proto | 36 +++ .../workflowservice/v1/request_response.proto | 53 +++++ temporal/api/workflowservice/v1/service.proto | 13 ++ 5 files changed, 509 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 379169614..126a3c495 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1457,6 +1457,45 @@ ] } }, + "/api/v1/namespaces/{namespace}/task-queues/update-config": { + "post": { + "summary": "Update taskqueue config and uncouple taskqueue settings from the worker lifecycle", + "operationId": "UpdateTaskQueueConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateTaskQueueConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateTaskQueueConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/task-queues/{taskQueue.name}": { "get": { "summary": "DescribeTaskQueue returns the following information about the target task queue, broken down by Build ID:\n - List of pollers\n - Workflow Reachability status\n - Backlog info for Workflow and/or Activity tasks", @@ -1603,6 +1642,13 @@ "in": "query", "required": false, "type": "boolean" + }, + { + "name": "showTaskQueueConfig", + "description": "Show Task Queue Config", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -5097,6 +5143,45 @@ ] } }, + "/namespaces/{namespace}/task-queues/update-config": { + "post": { + "summary": "Update taskqueue config and uncouple taskqueue settings from the worker lifecycle", + "operationId": "UpdateTaskQueueConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateTaskQueueConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateTaskQueueConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/task-queues/{taskQueue.name}": { "get": { "summary": "DescribeTaskQueue returns the following information about the target task queue, broken down by Build ID:\n - List of pollers\n - Workflow Reachability status\n - Backlog info for Workflow and/or Activity tasks", @@ -5243,6 +5328,13 @@ "in": "query", "required": false, "type": "boolean" + }, + { + "name": "showTaskQueueConfig", + "description": "Show Task Queue Config", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -7149,6 +7241,37 @@ }, "description": "An operation completed successfully." }, + "UpdateTaskQueueConfigRequestRateLimitUpdate": { + "type": "object", + "properties": { + "requestsPerSecond": { + "type": "number", + "format": "float" + }, + "reason": { + "type": "string", + "description": "Reason for why the rate limit was set." + } + } + }, + "UpdateTaskQueueConfigRequestUpdateFairnessKeyRateLimitDefault": { + "type": "object", + "properties": { + "rateLimit": { + "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", + "description": "Default rate limit to apply for all fairness keys.\nIf null, removes the existing rate limit." + } + } + }, + "UpdateTaskQueueConfigRequestUpdateQueueRateLimit": { + "type": "object", + "properties": { + "rateLimit": { + "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", + "description": "Rate limit to apply to task queue.\nIt must be less than or equal to the system-level setting at the time\nof the request. If null, removes the existing rate limit." + } + } + }, "UpdateWorkerBuildIdCompatibilityRequestAddNewCompatibleVersion": { "type": "object", "properties": { @@ -8451,6 +8574,29 @@ } } }, + "WorkflowServiceUpdateTaskQueueConfigBody": { + "type": "object", + "properties": { + "identity": { + "type": "string" + }, + "taskQueueName": { + "type": "string", + "description": "Selects the task queue to update." + }, + "taskQueueType": { + "$ref": "#/definitions/v1TaskQueueType" + }, + "updateQueueRateLimit": { + "$ref": "#/definitions/UpdateTaskQueueConfigRequestUpdateQueueRateLimit", + "description": "Update to queue-wide rate limit.\nIf not set, this configuration is unchanged.\nNOTE: A limit set by the worker is overriden; and restored again when reset." + }, + "updateFairnessKeyRateLimitDefault": { + "$ref": "#/definitions/UpdateTaskQueueConfigRequestUpdateFairnessKeyRateLimitDefault", + "description": "Update to the default fairness key rate limit.\nIf not set, this configuration is unchanged." + } + } + }, "WorkflowServiceUpdateWorkerDeploymentVersionMetadataBody": { "type": "object", "properties": { @@ -9888,6 +10034,28 @@ } } }, + "v1ConfigMetadata": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "Reason for why the rate limit was set." + }, + "source": { + "type": "string", + "description": "Can be \"system\", \"worker\" or \"api\"." + }, + "identity": { + "type": "string", + "description": "Identity of the last updater.\nSet by the request's identity field." + }, + "updateTime": { + "type": "string", + "format": "date-time", + "description": "Time of the last update." + } + } + }, "v1ContinueAsNewInitiator": { "type": "string", "enum": [ @@ -10305,6 +10473,9 @@ "$ref": "#/definitions/v1TaskQueueVersionInfo" }, "description": "Deprecated.\nOnly returned in ENHANCED mode.\nThis map contains Task Queue information for each Build ID. Empty string as key value means unversioned." + }, + "configs": { + "$ref": "#/definitions/v1TaskQueueConfig" } } }, @@ -12670,6 +12841,27 @@ }, "description": "Range represents a set of integer values, used to match fields of a calendar\ntime in StructuredCalendarSpec. If end < start, then end is interpreted as\nequal to start. This means you can use a Range with start set to a value, and\nend and step unset (defaulting to 0) to represent a single value." }, + "v1RateLimit": { + "type": "object", + "properties": { + "requestsPerSecond": { + "type": "number", + "format": "float", + "description": "Zero is a valid rate limit." + } + } + }, + "v1RateLimitConfig": { + "type": "object", + "properties": { + "rateLimit": { + "$ref": "#/definitions/v1RateLimit" + }, + "metadata": { + "$ref": "#/definitions/v1ConfigMetadata" + } + } + }, "v1RecordActivityTaskHeartbeatByIdResponse": { "type": "object", "properties": { @@ -14428,6 +14620,24 @@ }, "title": "See https://docs.temporal.io/docs/concepts/task-queues/" }, + "v1TaskQueueConfig": { + "type": "object", + "properties": { + "taskQueue": { + "$ref": "#/definitions/v1TaskQueue" + }, + "taskQueueType": { + "$ref": "#/definitions/v1TaskQueueType" + }, + "queueRateLimit": { + "$ref": "#/definitions/v1RateLimitConfig", + "description": "Unless modified, this is the system-defined rate limit." + }, + "fairnessKeysRateLimitDefault": { + "$ref": "#/definitions/v1RateLimitConfig" + } + } + }, "v1TaskQueueKind": { "type": "string", "enum": [ @@ -14879,6 +15089,14 @@ "v1UpdateScheduleResponse": { "type": "object" }, + "v1UpdateTaskQueueConfigResponse": { + "type": "object", + "properties": { + "configs": { + "$ref": "#/definitions/v1TaskQueueConfig" + } + } + }, "v1UpdateWorkerBuildIdCompatibilityResponse": { "type": "object", "title": "[cleanup-wv-pre-release]" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 8ad94127e..32d5ef012 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1300,6 +1300,37 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/task-queues/update-config: + post: + tags: + - WorkflowService + description: Update taskqueue config and uncouple taskqueue settings from the worker lifecycle + operationId: UpdateTaskQueueConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskQueueConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskQueueConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility: get: tags: @@ -1501,6 +1532,11 @@ paths: per task type). schema: type: boolean + - name: showTaskQueueConfig + in: query + description: Show Task Queue Config + schema: + type: boolean responses: "200": description: OK @@ -4566,6 +4602,37 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/task-queues/update-config: + post: + tags: + - WorkflowService + description: Update taskqueue config and uncouple taskqueue settings from the worker lifecycle + operationId: UpdateTaskQueueConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskQueueConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskQueueConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility: get: tags: @@ -4767,6 +4834,11 @@ paths: per task type). schema: type: boolean + - name: showTaskQueueConfig + in: query + description: Show Task Queue Config + schema: + type: boolean responses: "200": description: OK @@ -7125,6 +7197,24 @@ components: description: |- Used by the worker versioning APIs, represents an unordered set of one or more versions which are considered to be compatible with each other. Currently the versions are always worker build IDs. + ConfigMetadata: + type: object + properties: + reason: + type: string + description: Reason for why the rate limit was set. + source: + type: string + description: Can be "system", "worker" or "api". + identity: + type: string + description: |- + Identity of the last updater. + Set by the request's identity field. + updateTime: + type: string + description: Time of the last update. + format: date-time CountWorkflowExecutionsResponse: type: object properties: @@ -7519,6 +7609,8 @@ components: Deprecated. Only returned in ENHANCED mode. This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. + configs: + $ref: '#/components/schemas/TaskQueueConfig' DescribeWorkerDeploymentResponse: type: object properties: @@ -9611,6 +9703,20 @@ components: time in StructuredCalendarSpec. If end < start, then end is interpreted as equal to start. This means you can use a Range with start set to a value, and end and step unset (defaulting to 0) to represent a single value. + RateLimit: + type: object + properties: + requestsPerSecond: + type: number + description: Zero is a valid rate limit. + format: float + RateLimitConfig: + type: object + properties: + rateLimit: + $ref: '#/components/schemas/RateLimit' + metadata: + $ref: '#/components/schemas/ConfigMetadata' RecordActivityTaskHeartbeatByIdRequest: type: object properties: @@ -11613,6 +11719,25 @@ components: Iff kind == TASK_QUEUE_KIND_STICKY, then this field contains the name of the normal task queue that the sticky worker is running on. description: See https://docs.temporal.io/docs/concepts/task-queues/ + TaskQueueConfig: + type: object + properties: + taskQueue: + $ref: '#/components/schemas/TaskQueue' + taskQueueType: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + queueRateLimit: + allOf: + - $ref: '#/components/schemas/RateLimitConfig' + description: Unless modified, this is the system-defined rate limit. + fairnessKeysRateLimitDefault: + $ref: '#/components/schemas/RateLimitConfig' TaskQueueReachability: type: object properties: @@ -12147,6 +12272,70 @@ components: UpdateScheduleResponse: type: object properties: {} + UpdateTaskQueueConfigRequest: + type: object + properties: + namespace: + type: string + identity: + type: string + taskQueueName: + type: string + description: Selects the task queue to update. + taskQueueType: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + updateQueueRateLimit: + allOf: + - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_UpdateQueueRateLimit' + description: |- + Update to queue-wide rate limit. + If not set, this configuration is unchanged. + NOTE: A limit set by the worker is overriden; and restored again when reset. + updateFairnessKeyRateLimitDefault: + allOf: + - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_UpdateFairnessKeyRateLimitDefault' + description: |- + Update to the default fairness key rate limit. + If not set, this configuration is unchanged. + UpdateTaskQueueConfigRequest_RateLimitUpdate: + type: object + properties: + requestsPerSecond: + type: number + format: float + reason: + type: string + description: Reason for why the rate limit was set. + UpdateTaskQueueConfigRequest_UpdateFairnessKeyRateLimitDefault: + type: object + properties: + rateLimit: + allOf: + - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' + description: |- + Default rate limit to apply for all fairness keys. + If null, removes the existing rate limit. + UpdateTaskQueueConfigRequest_UpdateQueueRateLimit: + type: object + properties: + rateLimit: + allOf: + - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' + description: |- + Rate limit to apply to task queue. + It must be less than or equal to the system-level setting at the time + of the request. If null, removes the existing rate limit. + UpdateTaskQueueConfigResponse: + type: object + properties: + configs: + $ref: '#/components/schemas/TaskQueueConfig' UpdateWorkerDeploymentVersionMetadataRequest: type: object properties: diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index 364c00595..dab4ad2fb 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -315,3 +315,39 @@ message PollerScalingDecision { // all slots are already occupied. int32 poll_request_delta_suggestion = 1; } + +message RateLimit { + + // Zero is a valid rate limit. + float requests_per_second = 1; + +} + +message ConfigMetadata { + + // Reason for why the rate limit was set. + string reason = 1; + + // Can be "system", "worker" or "api". + string source = 2; + + // Identity of the last updater. + // Set by the request's identity field. + string identity = 3; + + // Time of the last update. + google.protobuf.Timestamp update_time = 4; +} + +message RateLimitConfig { + RateLimit rate_limit = 1; + ConfigMetadata metadata = 2; +} + +message TaskQueueConfig { + TaskQueue task_queue = 1; + temporal.api.enums.v1.TaskQueueType task_queue_type = 2; + // Unless modified, this is the system-defined rate limit. + RateLimitConfig queue_rate_limit = 3; + RateLimitConfig fairness_keys_rate_limit_default = 4; +} \ No newline at end of file diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index af031f3c9..372189515 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -985,6 +985,9 @@ message RespondQueryTaskCompletedRequest { // traces. // Mutually exclusive with `query_result`. Set when the query fails. temporal.api.failure.v1.Failure failure = 7; + // Why did the task fail? It's important to note that many of the variants in this enum cannot + // apply to worker responses. See the type's doc for more. + temporal.api.enums.v1.WorkflowTaskFailedCause cause = 8; } message RespondQueryTaskCompletedResponse { @@ -1083,6 +1086,9 @@ message DescribeTaskQueueRequest { // Report task reachability for the requested versions and all task types (task reachability is not reported // per task type). bool report_task_reachability = 10 [deprecated = true]; + + // Show Task Queue Config + bool show_task_queue_config = 11; } message DescribeTaskQueueResponse { @@ -1110,6 +1116,8 @@ message DescribeTaskQueueResponse { // Only returned in ENHANCED mode. // This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. map versions_info = 3 [deprecated = true]; + + temporal.api.taskqueue.v1.TaskQueueConfig configs = 6; } message GetClusterInfoRequest { @@ -2404,3 +2412,48 @@ message ListWorkersResponse { // Next page token bytes next_page_token = 2; } + +message UpdateTaskQueueConfigRequest { + message RateLimitUpdate { + + float requests_per_second = 1; + + // Reason for why the rate limit was set. + string reason = 2; + + } + + message UpdateQueueRateLimit { + // Rate limit to apply to task queue. + // It must be less than or equal to the system-level setting at the time + // of the request. If null, removes the existing rate limit. + RateLimitUpdate rate_limit = 1; + } + + message UpdateFairnessKeyRateLimitDefault { + // Default rate limit to apply for all fairness keys. + // If null, removes the existing rate limit. + RateLimitUpdate rate_limit = 1; + } + + string namespace = 1; + string identity = 2; + + // Selects the task queue to update. + string task_queue_name = 3; + + temporal.api.enums.v1.TaskQueueType task_queue_type = 4; + + // Update to queue-wide rate limit. + // If not set, this configuration is unchanged. + // NOTE: A limit set by the worker is overriden; and restored again when reset. + UpdateQueueRateLimit update_queue_rate_limit = 5; + + // Update to the default fairness key rate limit. + // If not set, this configuration is unchanged. + UpdateFairnessKeyRateLimitDefault update_fairness_key_rate_limit_default = 6; +} + +message UpdateTaskQueueConfigResponse { + temporal.api.taskqueue.v1.TaskQueueConfig configs = 1; +} \ No newline at end of file diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index bfa622dcd..0773e1338 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1194,4 +1194,17 @@ service WorkflowService { } }; } + + // Update taskqueue config and uncouple taskqueue settings from the worker lifecycle + rpc UpdateTaskQueueConfig (UpdateTaskQueueConfigRequest) returns (UpdateTaskQueueConfigResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/task-queues/update-config" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/task-queues/update-config" + body: "*" + } + }; + } + } From 5afad0194a777111249a8b94908014ae519399ea Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Tue, 24 Jun 2025 17:41:33 -0700 Subject: [PATCH 02/18] Review comments incorporated --- openapi/openapiv2.json | 202 ++++++++++-------- openapi/openapiv3.yaml | 53 +++-- temporal/api/enums/v1/common.proto | 7 + temporal/api/taskqueue/v1/message.proto | 11 +- .../workflowservice/v1/request_response.proto | 62 +++--- temporal/api/workflowservice/v1/service.proto | 6 +- 6 files changed, 189 insertions(+), 152 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 126a3c495..7b5205f64 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1457,45 +1457,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/task-queues/update-config": { - "post": { - "summary": "Update taskqueue config and uncouple taskqueue settings from the worker lifecycle", - "operationId": "UpdateTaskQueueConfig2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateTaskQueueConfigResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateTaskQueueConfigBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/task-queues/{taskQueue.name}": { "get": { "summary": "DescribeTaskQueue returns the following information about the target task queue, broken down by Build ID:\n - List of pollers\n - Workflow Reachability status\n - Backlog info for Workflow and/or Activity tasks", @@ -1656,6 +1617,52 @@ ] } }, + "/api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { + "post": { + "summary": "Update taskqueue config and uncouple taskqueue settings from the worker lifecycle\nrate limit set by this api overrides the worker-set rate limit\nIf unset worker rate limits continue to take effect", + "operationId": "UpdateTaskQueueConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateTaskQueueConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "taskQueueName", + "description": "Selects the task queue to update.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateTaskQueueConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility": { "get": { "summary": "Deprecated. Use `GetWorkerVersioningRules`.\nFetches the worker build id versioning sets for a task queue.", @@ -5143,45 +5150,6 @@ ] } }, - "/namespaces/{namespace}/task-queues/update-config": { - "post": { - "summary": "Update taskqueue config and uncouple taskqueue settings from the worker lifecycle", - "operationId": "UpdateTaskQueueConfig", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateTaskQueueConfigResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateTaskQueueConfigBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/namespaces/{namespace}/task-queues/{taskQueue.name}": { "get": { "summary": "DescribeTaskQueue returns the following information about the target task queue, broken down by Build ID:\n - List of pollers\n - Workflow Reachability status\n - Backlog info for Workflow and/or Activity tasks", @@ -5342,6 +5310,52 @@ ] } }, + "/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { + "post": { + "summary": "Update taskqueue config and uncouple taskqueue settings from the worker lifecycle\nrate limit set by this api overrides the worker-set rate limit\nIf unset worker rate limits continue to take effect", + "operationId": "UpdateTaskQueueConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateTaskQueueConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "taskQueueName", + "description": "Selects the task queue to update.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateTaskQueueConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility": { "get": { "summary": "Deprecated. Use `GetWorkerVersioningRules`.\nFetches the worker build id versioning sets for a task queue.", @@ -8580,10 +8594,6 @@ "identity": { "type": "string" }, - "taskQueueName": { - "type": "string", - "description": "Selects the task queue to update." - }, "taskQueueType": { "$ref": "#/definitions/v1TaskQueueType" }, @@ -10042,10 +10052,9 @@ "description": "Reason for why the rate limit was set." }, "source": { - "type": "string", - "description": "Can be \"system\", \"worker\" or \"api\"." + "$ref": "#/definitions/v1Source" }, - "identity": { + "updateIdentity": { "type": "string", "description": "Identity of the last updater.\nSet by the request's identity field." }, @@ -10474,7 +10483,7 @@ }, "description": "Deprecated.\nOnly returned in ENHANCED mode.\nThis map contains Task Queue information for each Build ID. Empty string as key value means unversioned." }, - "configs": { + "config": { "$ref": "#/definitions/v1TaskQueueConfig" } } @@ -14090,6 +14099,16 @@ "v1SignalWorkflowExecutionResponse": { "type": "object" }, + "v1Source": { + "type": "string", + "enum": [ + "SOURCE_UNSPECIFIED", + "SOURCE_API", + "SOURCE_SYSTEM", + "SOURCE_WORKER" + ], + "default": "SOURCE_UNSPECIFIED" + }, "v1StartBatchOperationResponse": { "type": "object" }, @@ -14623,18 +14642,13 @@ "v1TaskQueueConfig": { "type": "object", "properties": { - "taskQueue": { - "$ref": "#/definitions/v1TaskQueue" - }, - "taskQueueType": { - "$ref": "#/definitions/v1TaskQueueType" - }, "queueRateLimit": { "$ref": "#/definitions/v1RateLimitConfig", "description": "Unless modified, this is the system-defined rate limit." }, "fairnessKeysRateLimitDefault": { - "$ref": "#/definitions/v1RateLimitConfig" + "$ref": "#/definitions/v1RateLimitConfig", + "description": "If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key." } } }, @@ -15092,7 +15106,7 @@ "v1UpdateTaskQueueConfigResponse": { "type": "object", "properties": { - "configs": { + "config": { "$ref": "#/definitions/v1TaskQueueConfig" } } diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 32d5ef012..5f62512c6 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1300,11 +1300,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/task-queues/update-config: + /api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config: post: tags: - WorkflowService - description: Update taskqueue config and uncouple taskqueue settings from the worker lifecycle + description: |- + Update taskqueue config and uncouple taskqueue settings from the worker lifecycle + rate limit set by this api overrides the worker-set rate limit + If unset worker rate limits continue to take effect operationId: UpdateTaskQueueConfig parameters: - name: namespace @@ -1312,6 +1315,12 @@ paths: required: true schema: type: string + - name: taskQueueName + in: path + description: Selects the task queue to update. + required: true + schema: + type: string requestBody: content: application/json: @@ -4602,11 +4611,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/task-queues/update-config: + /namespaces/{namespace}/task-queues/{taskQueueName}/update-config: post: tags: - WorkflowService - description: Update taskqueue config and uncouple taskqueue settings from the worker lifecycle + description: |- + Update taskqueue config and uncouple taskqueue settings from the worker lifecycle + rate limit set by this api overrides the worker-set rate limit + If unset worker rate limits continue to take effect operationId: UpdateTaskQueueConfig parameters: - name: namespace @@ -4614,6 +4626,12 @@ paths: required: true schema: type: string + - name: taskQueueName + in: path + description: Selects the task queue to update. + required: true + schema: + type: string requestBody: content: application/json: @@ -7204,9 +7222,14 @@ components: type: string description: Reason for why the rate limit was set. source: + enum: + - SOURCE_UNSPECIFIED + - SOURCE_API + - SOURCE_SYSTEM + - SOURCE_WORKER type: string - description: Can be "system", "worker" or "api". - identity: + format: enum + updateIdentity: type: string description: |- Identity of the last updater. @@ -7609,7 +7632,7 @@ components: Deprecated. Only returned in ENHANCED mode. This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. - configs: + config: $ref: '#/components/schemas/TaskQueueConfig' DescribeWorkerDeploymentResponse: type: object @@ -11722,22 +11745,14 @@ components: TaskQueueConfig: type: object properties: - taskQueue: - $ref: '#/components/schemas/TaskQueue' - taskQueueType: - enum: - - TASK_QUEUE_TYPE_UNSPECIFIED - - TASK_QUEUE_TYPE_WORKFLOW - - TASK_QUEUE_TYPE_ACTIVITY - - TASK_QUEUE_TYPE_NEXUS - type: string - format: enum queueRateLimit: allOf: - $ref: '#/components/schemas/RateLimitConfig' description: Unless modified, this is the system-defined rate limit. fairnessKeysRateLimitDefault: - $ref: '#/components/schemas/RateLimitConfig' + allOf: + - $ref: '#/components/schemas/RateLimitConfig' + description: If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key. TaskQueueReachability: type: object properties: @@ -12334,7 +12349,7 @@ components: UpdateTaskQueueConfigResponse: type: object properties: - configs: + config: $ref: '#/components/schemas/TaskQueueConfig' UpdateWorkerDeploymentVersionMetadataRequest: type: object diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index 192c1d75b..610414b4c 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -106,3 +106,10 @@ enum WorkerStatus { WORKER_STATUS_SHUTTING_DOWN = 2; WORKER_STATUS_SHUTDOWN = 3; } + +enum Source { + SOURCE_UNSPECIFIED = 0; + SOURCE_API = 1; + SOURCE_SYSTEM = 2; + SOURCE_WORKER = 3; +} \ No newline at end of file diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index dab4ad2fb..aca8958c9 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -14,6 +14,7 @@ import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "temporal/api/enums/v1/task_queue.proto"; +import "temporal/api/enums/v1/common.proto"; import "temporal/api/common/v1/message.proto"; import "temporal/api/deployment/v1/message.proto"; @@ -328,12 +329,11 @@ message ConfigMetadata { // Reason for why the rate limit was set. string reason = 1; - // Can be "system", "worker" or "api". - string source = 2; - + temporal.api.enums.v1.Source source = 2; + // Identity of the last updater. // Set by the request's identity field. - string identity = 3; + string update_identity = 3; // Time of the last update. google.protobuf.Timestamp update_time = 4; @@ -345,9 +345,8 @@ message RateLimitConfig { } message TaskQueueConfig { - TaskQueue task_queue = 1; - temporal.api.enums.v1.TaskQueueType task_queue_type = 2; // Unless modified, this is the system-defined rate limit. RateLimitConfig queue_rate_limit = 3; + // If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key. RateLimitConfig fairness_keys_rate_limit_default = 4; } \ No newline at end of file diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 372189515..42edd05f6 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1117,7 +1117,7 @@ message DescribeTaskQueueResponse { // This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. map versions_info = 3 [deprecated = true]; - temporal.api.taskqueue.v1.TaskQueueConfig configs = 6; + temporal.api.taskqueue.v1.TaskQueueConfig config = 6; } message GetClusterInfoRequest { @@ -2423,37 +2423,37 @@ message UpdateTaskQueueConfigRequest { } - message UpdateQueueRateLimit { - // Rate limit to apply to task queue. - // It must be less than or equal to the system-level setting at the time - // of the request. If null, removes the existing rate limit. - RateLimitUpdate rate_limit = 1; - } - - message UpdateFairnessKeyRateLimitDefault { - // Default rate limit to apply for all fairness keys. - // If null, removes the existing rate limit. - RateLimitUpdate rate_limit = 1; - } - - string namespace = 1; - string identity = 2; - - // Selects the task queue to update. - string task_queue_name = 3; - - temporal.api.enums.v1.TaskQueueType task_queue_type = 4; - - // Update to queue-wide rate limit. - // If not set, this configuration is unchanged. - // NOTE: A limit set by the worker is overriden; and restored again when reset. - UpdateQueueRateLimit update_queue_rate_limit = 5; - - // Update to the default fairness key rate limit. - // If not set, this configuration is unchanged. - UpdateFairnessKeyRateLimitDefault update_fairness_key_rate_limit_default = 6; + message UpdateQueueRateLimit { + // Rate limit to apply to task queue. + // It must be less than or equal to the system-level setting at the time + // of the request. If null, removes the existing rate limit. + RateLimitUpdate rate_limit = 1; + } + + message UpdateFairnessKeyRateLimitDefault { + // Default rate limit to apply for all fairness keys. + // If null, removes the existing rate limit. + RateLimitUpdate rate_limit = 1; + } + + string namespace = 1; + string identity = 2; + + // Selects the task queue to update. + string task_queue_name = 3; + + temporal.api.enums.v1.TaskQueueType task_queue_type = 4; + + // Update to queue-wide rate limit. + // If not set, this configuration is unchanged. + // NOTE: A limit set by the worker is overriden; and restored again when reset. + UpdateQueueRateLimit update_queue_rate_limit = 5; + + // Update to the default fairness key rate limit. + // If not set, this configuration is unchanged. + UpdateFairnessKeyRateLimitDefault update_fairness_key_rate_limit_default = 6; } message UpdateTaskQueueConfigResponse { - temporal.api.taskqueue.v1.TaskQueueConfig configs = 1; + temporal.api.taskqueue.v1.TaskQueueConfig config = 1; } \ No newline at end of file diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 0773e1338..4addfdb22 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1196,12 +1196,14 @@ service WorkflowService { } // Update taskqueue config and uncouple taskqueue settings from the worker lifecycle + // rate limit set by this api overrides the worker-set rate limit + // If unset worker rate limits continue to take effect rpc UpdateTaskQueueConfig (UpdateTaskQueueConfigRequest) returns (UpdateTaskQueueConfigResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/task-queues/update-config" + post: "/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/task-queues/update-config" + post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" body: "*" } }; From a29c0f80345703985cce0c479e5770b24b7bbed9 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Tue, 24 Jun 2025 23:16:02 -0700 Subject: [PATCH 03/18] Indentation fixed --- temporal/api/workflowservice/v1/request_response.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 42edd05f6..1888f3b62 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2416,10 +2416,10 @@ message ListWorkersResponse { message UpdateTaskQueueConfigRequest { message RateLimitUpdate { - float requests_per_second = 1; + float requests_per_second = 1; - // Reason for why the rate limit was set. - string reason = 2; + // Reason for why the rate limit was set. + string reason = 2; } From 7d9544c32830bb34f06b33edf2779a7b489d5462 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 09:44:32 -0700 Subject: [PATCH 04/18] Update comment against reason to make configMetaData Generic. --- openapi/openapiv2.json | 2 +- openapi/openapiv3.yaml | 2 +- temporal/api/taskqueue/v1/message.proto | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 7b5205f64..ceffe2206 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10049,7 +10049,7 @@ "properties": { "reason": { "type": "string", - "description": "Reason for why the rate limit was set." + "description": "Reason for why the config was set." }, "source": { "$ref": "#/definitions/v1Source" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 5f62512c6..415ddaa24 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7220,7 +7220,7 @@ components: properties: reason: type: string - description: Reason for why the rate limit was set. + description: Reason for why the config was set. source: enum: - SOURCE_UNSPECIFIED diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index aca8958c9..048df85bb 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -326,7 +326,7 @@ message RateLimit { message ConfigMetadata { - // Reason for why the rate limit was set. + // Reason for why the config was set. string reason = 1; temporal.api.enums.v1.Source source = 2; From 0376041be25c8230b3685ffbc1449a7e36b376ac Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 11:07:24 -0700 Subject: [PATCH 05/18] Fixed tab spaces --- temporal/api/workflowservice/v1/request_response.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 1888f3b62..b123d7b20 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2414,12 +2414,12 @@ message ListWorkersResponse { } message UpdateTaskQueueConfigRequest { - message RateLimitUpdate { + message RateLimitUpdate { - float requests_per_second = 1; + float requests_per_second = 1; - // Reason for why the rate limit was set. - string reason = 2; + // Reason for why the rate limit was set. + string reason = 2; } From 602e6f0b00c065d3e6c5c5e2db7823636a452ff4 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 11:09:52 -0700 Subject: [PATCH 06/18] Indentation fix --- temporal/api/workflowservice/v1/request_response.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index b123d7b20..68ed37931 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2421,7 +2421,7 @@ message UpdateTaskQueueConfigRequest { // Reason for why the rate limit was set. string reason = 2; - } + } message UpdateQueueRateLimit { // Rate limit to apply to task queue. From 0446be3b3852cc86386020be337c52a45b0ae8d2 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 11:15:43 -0700 Subject: [PATCH 07/18] added newlines for consistency --- temporal/api/enums/v1/common.proto | 2 +- temporal/api/taskqueue/v1/message.proto | 2 +- temporal/api/workflowservice/v1/request_response.proto | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index 610414b4c..48e09daf4 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -112,4 +112,4 @@ enum Source { SOURCE_API = 1; SOURCE_SYSTEM = 2; SOURCE_WORKER = 3; -} \ No newline at end of file +} diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index 048df85bb..38d8eef6f 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -349,4 +349,4 @@ message TaskQueueConfig { RateLimitConfig queue_rate_limit = 3; // If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key. RateLimitConfig fairness_keys_rate_limit_default = 4; -} \ No newline at end of file +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 68ed37931..a23c29bbd 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2456,4 +2456,4 @@ message UpdateTaskQueueConfigRequest { message UpdateTaskQueueConfigResponse { temporal.api.taskqueue.v1.TaskQueueConfig config = 1; -} \ No newline at end of file +} From 0a13fd7bad083faf9a58f5a697f6d092fda0a4a8 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 13:45:41 -0700 Subject: [PATCH 08/18] Removed the source field + Only the config data set from the api is persisted the default configs w.r.t to workers are in memory. + Source need not be persisted in this case. --- openapi/openapiv2.json | 13 ------------- openapi/openapiv3.yaml | 8 -------- temporal/api/enums/v1/common.proto | 7 ------- temporal/api/taskqueue/v1/message.proto | 3 --- 4 files changed, 31 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 5a9cc0a24..fce7613db 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10051,9 +10051,6 @@ "type": "string", "description": "Reason for why the config was set." }, - "source": { - "$ref": "#/definitions/v1Source" - }, "updateIdentity": { "type": "string", "description": "Identity of the last updater.\nSet by the request's identity field." @@ -14099,16 +14096,6 @@ "v1SignalWorkflowExecutionResponse": { "type": "object" }, - "v1Source": { - "type": "string", - "enum": [ - "SOURCE_UNSPECIFIED", - "SOURCE_API", - "SOURCE_SYSTEM", - "SOURCE_WORKER" - ], - "default": "SOURCE_UNSPECIFIED" - }, "v1StartBatchOperationResponse": { "type": "object" }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index e80d765a0..a674d59d8 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7221,14 +7221,6 @@ components: reason: type: string description: Reason for why the config was set. - source: - enum: - - SOURCE_UNSPECIFIED - - SOURCE_API - - SOURCE_SYSTEM - - SOURCE_WORKER - type: string - format: enum updateIdentity: type: string description: |- diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index 48e09daf4..192c1d75b 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -106,10 +106,3 @@ enum WorkerStatus { WORKER_STATUS_SHUTTING_DOWN = 2; WORKER_STATUS_SHUTDOWN = 3; } - -enum Source { - SOURCE_UNSPECIFIED = 0; - SOURCE_API = 1; - SOURCE_SYSTEM = 2; - SOURCE_WORKER = 3; -} diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index 38d8eef6f..373391303 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -14,7 +14,6 @@ import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "temporal/api/enums/v1/task_queue.proto"; -import "temporal/api/enums/v1/common.proto"; import "temporal/api/common/v1/message.proto"; import "temporal/api/deployment/v1/message.proto"; @@ -328,8 +327,6 @@ message ConfigMetadata { // Reason for why the config was set. string reason = 1; - - temporal.api.enums.v1.Source source = 2; // Identity of the last updater. // Set by the request's identity field. From 729b2db705481d512ed50e535656deb90cc273d2 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 16:46:03 -0700 Subject: [PATCH 09/18] + Removed source from config and moved it to DescribeTaskQueue + Refactored protos --- openapi/openapiv2.json | 85 +++++++++---------- openapi/openapiv3.yaml | 73 +++++++--------- temporal/api/enums/v1/common.proto | 8 ++ .../workflowservice/v1/request_response.proto | 41 ++++----- temporal/api/workflowservice/v1/service.proto | 1 - 5 files changed, 99 insertions(+), 109 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index fce7613db..a249fd571 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1529,6 +1529,13 @@ "required": false, "type": "boolean" }, + { + "name": "showTaskQueueConfig", + "description": "Show Task Queue Config", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "includeTaskQueueStatus", "description": "Deprecated, use `report_stats` instead.\nIf true, the task queue status will be included in the response.", @@ -1603,13 +1610,6 @@ "in": "query", "required": false, "type": "boolean" - }, - { - "name": "showTaskQueueConfig", - "description": "Show Task Queue Config", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -5222,6 +5222,13 @@ "required": false, "type": "boolean" }, + { + "name": "showTaskQueueConfig", + "description": "Show Task Queue Config", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "includeTaskQueueStatus", "description": "Deprecated, use `report_stats` instead.\nIf true, the task queue status will be included in the response.", @@ -5296,13 +5303,6 @@ "in": "query", "required": false, "type": "boolean" - }, - { - "name": "showTaskQueueConfig", - "description": "Show Task Queue Config", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -7258,9 +7258,9 @@ "UpdateTaskQueueConfigRequestRateLimitUpdate": { "type": "object", "properties": { - "requestsPerSecond": { - "type": "number", - "format": "float" + "rateLimit": { + "$ref": "#/definitions/v1RateLimit", + "title": "Rate Limit to be updated" }, "reason": { "type": "string", @@ -7268,24 +7268,6 @@ } } }, - "UpdateTaskQueueConfigRequestUpdateFairnessKeyRateLimitDefault": { - "type": "object", - "properties": { - "rateLimit": { - "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", - "description": "Default rate limit to apply for all fairness keys.\nIf null, removes the existing rate limit." - } - } - }, - "UpdateTaskQueueConfigRequestUpdateQueueRateLimit": { - "type": "object", - "properties": { - "rateLimit": { - "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", - "description": "Rate limit to apply to task queue.\nIt must be less than or equal to the system-level setting at the time\nof the request. If null, removes the existing rate limit." - } - } - }, "UpdateWorkerBuildIdCompatibilityRequestAddNewCompatibleVersion": { "type": "object", "properties": { @@ -8598,11 +8580,11 @@ "$ref": "#/definitions/v1TaskQueueType" }, "updateQueueRateLimit": { - "$ref": "#/definitions/UpdateTaskQueueConfigRequestUpdateQueueRateLimit", - "description": "Update to queue-wide rate limit.\nIf not set, this configuration is unchanged.\nNOTE: A limit set by the worker is overriden; and restored again when reset." + "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", + "description": "Update to queue-wide rate limit.\nIf not set, this configuration is unchanged.\nNOTE: A limit set by the worker is overriden; and restored again when reset.\nIt must be less than or equal to the system-level setting at the time\nof the request. If null, removes the existing rate limit." }, "updateFairnessKeyRateLimitDefault": { - "$ref": "#/definitions/UpdateTaskQueueConfigRequestUpdateFairnessKeyRateLimitDefault", + "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", "description": "Update to the default fairness key rate limit.\nIf not set, this configuration is unchanged." } } @@ -10461,13 +10443,20 @@ "$ref": "#/definitions/v1PollerInfo" } }, + "versioningInfo": { + "$ref": "#/definitions/v1TaskQueueVersioningInfo", + "description": "Specifies which Worker Deployment Version(s) Server routes this Task Queue's tasks to.\nWhen not present, it means the tasks are routed to Unversioned workers (workers with\nUNVERSIONED or unspecified WorkerVersioningMode.)\nTask Queue Versioning info is updated indirectly by calling SetWorkerDeploymentCurrentVersion\nand SetWorkerDeploymentRampingVersion on Worker Deployments.\nNote: This information is not relevant to Pinned workflow executions and their activities as\nthey are always routed to their Pinned Deployment Version. However, new workflow executions\nare typically not Pinned until they complete their first task (unless they are started with\na Pinned VersioningOverride or are Child Workflows of a Pinned parent)." + }, "stats": { "$ref": "#/definitions/v1TaskQueueStats", "description": "Statistics for the task queue. Only populated when `report_stats` is set to true in the request." }, - "versioningInfo": { - "$ref": "#/definitions/v1TaskQueueVersioningInfo", - "description": "Specifies which Worker Deployment Version(s) Server routes this Task Queue's tasks to.\nWhen not present, it means the tasks are routed to Unversioned workers (workers with\nUNVERSIONED or unspecified WorkerVersioningMode.)\nTask Queue Versioning info is updated indirectly by calling SetWorkerDeploymentCurrentVersion\nand SetWorkerDeploymentRampingVersion on Worker Deployments.\nNote: This information is not relevant to Pinned workflow executions and their activities as\nthey are always routed to their Pinned Deployment Version. However, new workflow executions\nare typically not Pinned until they complete their first task (unless they are started with\na Pinned VersioningOverride or are Child Workflows of a Pinned parent)." + "config": { + "$ref": "#/definitions/v1TaskQueueConfig" + }, + "source": { + "$ref": "#/definitions/v1Source", + "title": "Source of the update" }, "taskQueueStatus": { "$ref": "#/definitions/v1TaskQueueStatus", @@ -10479,9 +10468,6 @@ "$ref": "#/definitions/v1TaskQueueVersionInfo" }, "description": "Deprecated.\nOnly returned in ENHANCED mode.\nThis map contains Task Queue information for each Build ID. Empty string as key value means unversioned." - }, - "config": { - "$ref": "#/definitions/v1TaskQueueConfig" } } }, @@ -14096,6 +14082,17 @@ "v1SignalWorkflowExecutionResponse": { "type": "object" }, + "v1Source": { + "type": "string", + "enum": [ + "SOURCE_UNSPECIFIED", + "SOURCE_API", + "SOURCE_WORKER", + "SOURCE_SYSTEM" + ], + "default": "SOURCE_UNSPECIFIED", + "title": "Source for the update" + }, "v1StartBatchOperationResponse": { "type": "object" }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index a674d59d8..6ac58e033 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1473,6 +1473,11 @@ paths: description: Report stats for the requested task queue type(s). schema: type: boolean + - name: showTaskQueueConfig + in: query + description: Show Task Queue Config + schema: + type: boolean - name: includeTaskQueueStatus in: query description: |- @@ -1541,11 +1546,6 @@ paths: per task type). schema: type: boolean - - name: showTaskQueueConfig - in: query - description: Show Task Queue Config - schema: - type: boolean responses: "200": description: OK @@ -4784,6 +4784,11 @@ paths: description: Report stats for the requested task queue type(s). schema: type: boolean + - name: showTaskQueueConfig + in: query + description: Show Task Queue Config + schema: + type: boolean - name: includeTaskQueueStatus in: query description: |- @@ -4852,11 +4857,6 @@ paths: per task type). schema: type: boolean - - name: showTaskQueueConfig - in: query - description: Show Task Queue Config - schema: - type: boolean responses: "200": description: OK @@ -7593,10 +7593,6 @@ components: type: array items: $ref: '#/components/schemas/PollerInfo' - stats: - allOf: - - $ref: '#/components/schemas/TaskQueueStats' - description: Statistics for the task queue. Only populated when `report_stats` is set to true in the request. versioningInfo: allOf: - $ref: '#/components/schemas/TaskQueueVersioningInfo' @@ -7610,6 +7606,21 @@ components: they are always routed to their Pinned Deployment Version. However, new workflow executions are typically not Pinned until they complete their first task (unless they are started with a Pinned VersioningOverride or are Child Workflows of a Pinned parent). + stats: + allOf: + - $ref: '#/components/schemas/TaskQueueStats' + description: Statistics for the task queue. Only populated when `report_stats` is set to true in the request. + config: + $ref: '#/components/schemas/TaskQueueConfig' + source: + enum: + - SOURCE_UNSPECIFIED + - SOURCE_API + - SOURCE_WORKER + - SOURCE_SYSTEM + type: string + description: Source of the update + format: enum taskQueueStatus: allOf: - $ref: '#/components/schemas/TaskQueueStatus' @@ -7624,8 +7635,6 @@ components: Deprecated. Only returned in ENHANCED mode. This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. - config: - $ref: '#/components/schemas/TaskQueueConfig' DescribeWorkerDeploymentResponse: type: object properties: @@ -12305,45 +12314,29 @@ components: format: enum updateQueueRateLimit: allOf: - - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_UpdateQueueRateLimit' + - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' description: |- Update to queue-wide rate limit. If not set, this configuration is unchanged. NOTE: A limit set by the worker is overriden; and restored again when reset. + It must be less than or equal to the system-level setting at the time + of the request. If null, removes the existing rate limit. updateFairnessKeyRateLimitDefault: allOf: - - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_UpdateFairnessKeyRateLimitDefault' + - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' description: |- Update to the default fairness key rate limit. If not set, this configuration is unchanged. UpdateTaskQueueConfigRequest_RateLimitUpdate: type: object properties: - requestsPerSecond: - type: number - format: float + rateLimit: + allOf: + - $ref: '#/components/schemas/RateLimit' + description: Rate Limit to be updated reason: type: string description: Reason for why the rate limit was set. - UpdateTaskQueueConfigRequest_UpdateFairnessKeyRateLimitDefault: - type: object - properties: - rateLimit: - allOf: - - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' - description: |- - Default rate limit to apply for all fairness keys. - If null, removes the existing rate limit. - UpdateTaskQueueConfigRequest_UpdateQueueRateLimit: - type: object - properties: - rateLimit: - allOf: - - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' - description: |- - Rate limit to apply to task queue. - It must be less than or equal to the system-level setting at the time - of the request. If null, removes the existing rate limit. UpdateTaskQueueConfigResponse: type: object properties: diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index 192c1d75b..656f4086f 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -106,3 +106,11 @@ enum WorkerStatus { WORKER_STATUS_SHUTTING_DOWN = 2; WORKER_STATUS_SHUTDOWN = 3; } + +// Source for the update +enum Source { + SOURCE_UNSPECIFIED = 0; + SOURCE_API = 1; + SOURCE_WORKER = 2; + SOURCE_SYSTEM = 3; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index a23c29bbd..e5d3e6025 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1058,6 +1058,9 @@ message DescribeTaskQueueRequest { // Report stats for the requested task queue type(s). bool report_stats = 8; + // Show Task Queue Config + bool show_task_queue_config = 11; + // Deprecated, use `report_stats` instead. // If true, the task queue status will be included in the response. bool include_task_queue_status = 4 [deprecated = true]; @@ -1086,17 +1089,11 @@ message DescribeTaskQueueRequest { // Report task reachability for the requested versions and all task types (task reachability is not reported // per task type). bool report_task_reachability = 10 [deprecated = true]; - - // Show Task Queue Config - bool show_task_queue_config = 11; } message DescribeTaskQueueResponse { repeated temporal.api.taskqueue.v1.PollerInfo pollers = 1; - // Statistics for the task queue. Only populated when `report_stats` is set to true in the request. - temporal.api.taskqueue.v1.TaskQueueStats stats = 5; - // Specifies which Worker Deployment Version(s) Server routes this Task Queue's tasks to. // When not present, it means the tasks are routed to Unversioned workers (workers with // UNVERSIONED or unspecified WorkerVersioningMode.) @@ -1108,6 +1105,14 @@ message DescribeTaskQueueResponse { // a Pinned VersioningOverride or are Child Workflows of a Pinned parent). temporal.api.taskqueue.v1.TaskQueueVersioningInfo versioning_info = 4; + // Statistics for the task queue. Only populated when `report_stats` is set to true in the request. + temporal.api.taskqueue.v1.TaskQueueStats stats = 5; + + temporal.api.taskqueue.v1.TaskQueueConfig config = 6; + + // Source of the update + temporal.api.enums.v1.Source source = 7; + // Deprecated. // Status of the task queue. Only populated when `include_task_queue_status` is set to true in the request. temporal.api.taskqueue.v1.TaskQueueStatus task_queue_status = 2 [deprecated = true]; @@ -1116,8 +1121,6 @@ message DescribeTaskQueueResponse { // Only returned in ENHANCED mode. // This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. map versions_info = 3 [deprecated = true]; - - temporal.api.taskqueue.v1.TaskQueueConfig config = 6; } message GetClusterInfoRequest { @@ -2416,26 +2419,14 @@ message ListWorkersResponse { message UpdateTaskQueueConfigRequest { message RateLimitUpdate { - float requests_per_second = 1; + // Rate Limit to be updated + temporal.api.taskqueue.v1.RateLimit rate_limit = 1; // Reason for why the rate limit was set. string reason = 2; } - message UpdateQueueRateLimit { - // Rate limit to apply to task queue. - // It must be less than or equal to the system-level setting at the time - // of the request. If null, removes the existing rate limit. - RateLimitUpdate rate_limit = 1; - } - - message UpdateFairnessKeyRateLimitDefault { - // Default rate limit to apply for all fairness keys. - // If null, removes the existing rate limit. - RateLimitUpdate rate_limit = 1; - } - string namespace = 1; string identity = 2; @@ -2447,11 +2438,13 @@ message UpdateTaskQueueConfigRequest { // Update to queue-wide rate limit. // If not set, this configuration is unchanged. // NOTE: A limit set by the worker is overriden; and restored again when reset. - UpdateQueueRateLimit update_queue_rate_limit = 5; + // It must be less than or equal to the system-level setting at the time + // of the request. If null, removes the existing rate limit. + RateLimitUpdate update_queue_rate_limit = 5; // Update to the default fairness key rate limit. // If not set, this configuration is unchanged. - UpdateFairnessKeyRateLimitDefault update_fairness_key_rate_limit_default = 6; + RateLimitUpdate update_fairness_key_rate_limit_default = 6; } message UpdateTaskQueueConfigResponse { diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 4addfdb22..824f2a556 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1208,5 +1208,4 @@ service WorkflowService { } }; } - } From 1fb2b1b824d457862ac6b96e77ad99c87d6a8acf Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 17:32:19 -0700 Subject: [PATCH 10/18] Fixed tags + removed unnecessary whitespaces --- temporal/api/taskqueue/v1/message.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index 373391303..bda71b5bb 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -330,10 +330,10 @@ message ConfigMetadata { // Identity of the last updater. // Set by the request's identity field. - string update_identity = 3; + string update_identity = 2; // Time of the last update. - google.protobuf.Timestamp update_time = 4; + google.protobuf.Timestamp update_time = 3; } message RateLimitConfig { @@ -343,7 +343,7 @@ message RateLimitConfig { message TaskQueueConfig { // Unless modified, this is the system-defined rate limit. - RateLimitConfig queue_rate_limit = 3; + RateLimitConfig queue_rate_limit = 1; // If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key. - RateLimitConfig fairness_keys_rate_limit_default = 4; + RateLimitConfig fairness_keys_rate_limit_default = 2; } From b04dc6ab44dcc9a7fedd245c3b0b577b55d22b89 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 17:47:32 -0700 Subject: [PATCH 11/18] Removed unnecessary blank lines --- temporal/api/taskqueue/v1/message.proto | 3 --- 1 file changed, 3 deletions(-) diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index bda71b5bb..4301e27a4 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -317,14 +317,11 @@ message PollerScalingDecision { } message RateLimit { - // Zero is a valid rate limit. float requests_per_second = 1; - } message ConfigMetadata { - // Reason for why the config was set. string reason = 1; From a9ef10c9c4b7095ffbb0363e159786ece4ee7ef3 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 19:06:26 -0700 Subject: [PATCH 12/18] Updated comments + added the openapi changes --- openapi/openapiv2.json | 4 ++-- openapi/openapiv3.yaml | 14 ++++++++------ .../api/workflowservice/v1/request_response.proto | 7 ------- temporal/api/workflowservice/v1/service.proto | 7 ++++--- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index a249fd571..eec778382 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1619,7 +1619,7 @@ }, "/api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { "post": { - "summary": "Update taskqueue config and uncouple taskqueue settings from the worker lifecycle\nrate limit set by this api overrides the worker-set rate limit\nIf unset worker rate limits continue to take effect", + "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", "operationId": "UpdateTaskQueueConfig2", "responses": { "200": { @@ -5312,7 +5312,7 @@ }, "/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { "post": { - "summary": "Update taskqueue config and uncouple taskqueue settings from the worker lifecycle\nrate limit set by this api overrides the worker-set rate limit\nIf unset worker rate limits continue to take effect", + "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", "operationId": "UpdateTaskQueueConfig", "responses": { "200": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 6ac58e033..417e93920 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1305,9 +1305,10 @@ paths: tags: - WorkflowService description: |- - Update taskqueue config and uncouple taskqueue settings from the worker lifecycle - rate limit set by this api overrides the worker-set rate limit - If unset worker rate limits continue to take effect + Updates task queue configuration. + For the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit, + which uncouples the rate limit from the worker lifecycle. + If the overall queue rate limit is unset, the worker-set rate limit takes effect. operationId: UpdateTaskQueueConfig parameters: - name: namespace @@ -4616,9 +4617,10 @@ paths: tags: - WorkflowService description: |- - Update taskqueue config and uncouple taskqueue settings from the worker lifecycle - rate limit set by this api overrides the worker-set rate limit - If unset worker rate limits continue to take effect + Updates task queue configuration. + For the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit, + which uncouples the rate limit from the worker lifecycle. + If the overall queue rate limit is unset, the worker-set rate limit takes effect. operationId: UpdateTaskQueueConfig parameters: - name: namespace diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index e5d3e6025..bbd7900bf 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2418,30 +2418,23 @@ message ListWorkersResponse { message UpdateTaskQueueConfigRequest { message RateLimitUpdate { - // Rate Limit to be updated temporal.api.taskqueue.v1.RateLimit rate_limit = 1; - // Reason for why the rate limit was set. string reason = 2; - } string namespace = 1; string identity = 2; - // Selects the task queue to update. string task_queue_name = 3; - temporal.api.enums.v1.TaskQueueType task_queue_type = 4; - // Update to queue-wide rate limit. // If not set, this configuration is unchanged. // NOTE: A limit set by the worker is overriden; and restored again when reset. // It must be less than or equal to the system-level setting at the time // of the request. If null, removes the existing rate limit. RateLimitUpdate update_queue_rate_limit = 5; - // Update to the default fairness key rate limit. // If not set, this configuration is unchanged. RateLimitUpdate update_fairness_key_rate_limit_default = 6; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 824f2a556..25d411a8a 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1195,9 +1195,10 @@ service WorkflowService { }; } - // Update taskqueue config and uncouple taskqueue settings from the worker lifecycle - // rate limit set by this api overrides the worker-set rate limit - // If unset worker rate limits continue to take effect + // Updates task queue configuration. + // For the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit, + // which uncouples the rate limit from the worker lifecycle. + // If the overall queue rate limit is unset, the worker-set rate limit takes effect. rpc UpdateTaskQueueConfig (UpdateTaskQueueConfigRequest) returns (UpdateTaskQueueConfigResponse) { option (google.api.http) = { post: "/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" From 626eace52ca903700e51ce0fe1ddfe917c6372da Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Wed, 25 Jun 2025 19:23:16 -0700 Subject: [PATCH 13/18] Comment added for config in DescribeTaskQueue Response --- openapi/openapiv2.json | 3 ++- openapi/openapiv3.yaml | 4 +++- temporal/api/workflowservice/v1/request_response.proto | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index eec778382..3db2857ed 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10452,7 +10452,8 @@ "description": "Statistics for the task queue. Only populated when `report_stats` is set to true in the request." }, "config": { - "$ref": "#/definitions/v1TaskQueueConfig" + "$ref": "#/definitions/v1TaskQueueConfig", + "description": "Only populated if show_task_queue_config is set to true." }, "source": { "$ref": "#/definitions/v1Source", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 417e93920..8227c5746 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7613,7 +7613,9 @@ components: - $ref: '#/components/schemas/TaskQueueStats' description: Statistics for the task queue. Only populated when `report_stats` is set to true in the request. config: - $ref: '#/components/schemas/TaskQueueConfig' + allOf: + - $ref: '#/components/schemas/TaskQueueConfig' + description: Only populated if show_task_queue_config is set to true. source: enum: - SOURCE_UNSPECIFIED diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index bbd7900bf..6005590b6 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1108,6 +1108,7 @@ message DescribeTaskQueueResponse { // Statistics for the task queue. Only populated when `report_stats` is set to true in the request. temporal.api.taskqueue.v1.TaskQueueStats stats = 5; + // Only populated if show_task_queue_config is set to true. temporal.api.taskqueue.v1.TaskQueueConfig config = 6; // Source of the update From b8cf2c29c4717ed2fe0510710047fc7f5d15995f Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Fri, 27 Jun 2025 09:03:05 -0700 Subject: [PATCH 14/18] Review comments incorporated from the PR. --- openapi/openapiv2.json | 86 +++++++++++++------ openapi/openapiv3.yaml | 71 +++++++++++---- temporal/api/enums/v1/common.proto | 8 -- temporal/api/enums/v1/task_queue.proto | 11 +++ .../workflowservice/v1/request_response.proto | 24 ++++-- temporal/api/workflowservice/v1/service.proto | 4 +- 6 files changed, 143 insertions(+), 61 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index aeaa84343..9867c7c99 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1530,8 +1530,8 @@ "type": "boolean" }, { - "name": "showTaskQueueConfig", - "description": "Show Task Queue Config", + "name": "reportTaskQueueConfig", + "description": "Report Task Queue Config", "in": "query", "required": false, "type": "boolean" @@ -1617,7 +1617,7 @@ ] } }, - "/api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { + "/api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config/{taskQueueType}": { "post": { "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", "operationId": "UpdateTaskQueueConfig2", @@ -1649,6 +1649,18 @@ "required": true, "type": "string" }, + { + "name": "taskQueueType", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "TASK_QUEUE_TYPE_UNSPECIFIED", + "TASK_QUEUE_TYPE_WORKFLOW", + "TASK_QUEUE_TYPE_ACTIVITY", + "TASK_QUEUE_TYPE_NEXUS" + ] + }, { "name": "body", "in": "body", @@ -5230,8 +5242,8 @@ "type": "boolean" }, { - "name": "showTaskQueueConfig", - "description": "Show Task Queue Config", + "name": "reportTaskQueueConfig", + "description": "Report Task Queue Config", "in": "query", "required": false, "type": "boolean" @@ -5317,7 +5329,7 @@ ] } }, - "/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { + "/namespaces/{namespace}/task-queues/{taskQueueName}/update-config/{taskQueueType}": { "post": { "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", "operationId": "UpdateTaskQueueConfig", @@ -5349,6 +5361,18 @@ "required": true, "type": "string" }, + { + "name": "taskQueueType", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "TASK_QUEUE_TYPE_UNSPECIFIED", + "TASK_QUEUE_TYPE_WORKFLOW", + "TASK_QUEUE_TYPE_ACTIVITY", + "TASK_QUEUE_TYPE_NEXUS" + ] + }, { "name": "body", "in": "body", @@ -7038,6 +7062,20 @@ } } }, + "DescribeTaskQueueResponseEffectiveRateLimit": { + "type": "object", + "properties": { + "queueRateLimitRps": { + "type": "number", + "format": "float", + "description": "The effective rate limit for the task queue." + }, + "rateLimitSource": { + "$ref": "#/definitions/v1RateLimitSource", + "title": "Source of the RateLimit Configuration,which can be one of the following values:\n- SOURCE_API: The rate limit that is set via the TaskQueueConfig api.\n- SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond.\n- SOURCE_SYSTEM: The rate limit is the default value set by the system" + } + } + }, "DescribeWorkerDeploymentVersionResponseVersionTaskQueue": { "type": "object", "properties": { @@ -8605,16 +8643,13 @@ "identity": { "type": "string" }, - "taskQueueType": { - "$ref": "#/definitions/v1TaskQueueType" - }, "updateQueueRateLimit": { "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", - "description": "Update to queue-wide rate limit.\nIf not set, this configuration is unchanged.\nNOTE: A limit set by the worker is overriden; and restored again when reset.\nIt must be less than or equal to the system-level setting at the time\nof the request. If null, removes the existing rate limit." + "description": "Update to queue-wide rate limit.\nIf not set, this configuration is unchanged.\nNOTE: A limit set by the worker is overriden; and restored again when reset.\nIf the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit." }, "updateFairnessKeyRateLimitDefault": { "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", - "description": "Update to the default fairness key rate limit.\nIf not set, this configuration is unchanged." + "description": "Update to the default fairness key rate limit.\nIf not set, this configuration is unchanged.\nIf the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit." } } }, @@ -10482,11 +10517,10 @@ }, "config": { "$ref": "#/definitions/v1TaskQueueConfig", - "description": "Only populated if show_task_queue_config is set to true." + "description": "Only populated if report_task_queue_config is set to true." }, - "source": { - "$ref": "#/definitions/v1Source", - "title": "Source of the update" + "effectiveRateLimit": { + "$ref": "#/definitions/DescribeTaskQueueResponseEffectiveRateLimit" }, "taskQueueStatus": { "$ref": "#/definitions/v1TaskQueueStatus", @@ -12892,6 +12926,17 @@ } } }, + "v1RateLimitSource": { + "type": "string", + "enum": [ + "RATE_LIMIT_SOURCE_UNSPECIFIED", + "RATE_LIMIT_SOURCE_API", + "RATE_LIMIT_SOURCE_WORKER", + "RATE_LIMIT_SOURCE_SYSTEM" + ], + "default": "RATE_LIMIT_SOURCE_UNSPECIFIED", + "description": "Source for the effective rate limit.\n\n - RATE_LIMIT_SOURCE_API: The value was set by the API.\n - RATE_LIMIT_SOURCE_WORKER: The value was set by a worker.\n - RATE_LIMIT_SOURCE_SYSTEM: The values was set as the system default." + }, "v1RecordActivityTaskHeartbeatByIdResponse": { "type": "object", "properties": { @@ -14120,17 +14165,6 @@ "v1SignalWorkflowExecutionResponse": { "type": "object" }, - "v1Source": { - "type": "string", - "enum": [ - "SOURCE_UNSPECIFIED", - "SOURCE_API", - "SOURCE_WORKER", - "SOURCE_SYSTEM" - ], - "default": "SOURCE_UNSPECIFIED", - "title": "Source for the update" - }, "v1StartBatchOperationResponse": { "type": "object" }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 5761c43f3..497db01e0 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1300,7 +1300,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config: + /api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config/{taskQueueType}: post: tags: - WorkflowService @@ -1322,6 +1322,17 @@ paths: required: true schema: type: string + - name: taskQueueType + in: path + required: true + schema: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum requestBody: content: application/json: @@ -1474,9 +1485,9 @@ paths: description: Report stats for the requested task queue type(s). schema: type: boolean - - name: showTaskQueueConfig + - name: reportTaskQueueConfig in: query - description: Show Task Queue Config + description: Report Task Queue Config schema: type: boolean - name: includeTaskQueueStatus @@ -4617,7 +4628,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/task-queues/{taskQueueName}/update-config: + /namespaces/{namespace}/task-queues/{taskQueueName}/update-config/{taskQueueType}: post: tags: - WorkflowService @@ -4639,6 +4650,17 @@ paths: required: true schema: type: string + - name: taskQueueType + in: path + required: true + schema: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum requestBody: content: application/json: @@ -4791,9 +4813,9 @@ paths: description: Report stats for the requested task queue type(s). schema: type: boolean - - name: showTaskQueueConfig + - name: reportTaskQueueConfig in: query - description: Show Task Queue Config + description: Report Task Queue Config schema: type: boolean - name: includeTaskQueueStatus @@ -7625,16 +7647,9 @@ components: config: allOf: - $ref: '#/components/schemas/TaskQueueConfig' - description: Only populated if show_task_queue_config is set to true. - source: - enum: - - SOURCE_UNSPECIFIED - - SOURCE_API - - SOURCE_WORKER - - SOURCE_SYSTEM - type: string - description: Source of the update - format: enum + description: Only populated if report_task_queue_config is set to true. + effectiveRateLimit: + $ref: '#/components/schemas/DescribeTaskQueueResponse_EffectiveRateLimit' taskQueueStatus: allOf: - $ref: '#/components/schemas/TaskQueueStatus' @@ -7649,6 +7664,26 @@ components: Deprecated. Only returned in ENHANCED mode. This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. + DescribeTaskQueueResponse_EffectiveRateLimit: + type: object + properties: + queueRateLimitRps: + type: number + description: The effective rate limit for the task queue. + format: float + rateLimitSource: + enum: + - RATE_LIMIT_SOURCE_UNSPECIFIED + - RATE_LIMIT_SOURCE_API + - RATE_LIMIT_SOURCE_WORKER + - RATE_LIMIT_SOURCE_SYSTEM + type: string + description: |- + Source of the RateLimit Configuration,which can be one of the following values: + - SOURCE_API: The rate limit that is set via the TaskQueueConfig api. + - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond. + - SOURCE_SYSTEM: The rate limit is the default value set by the system + format: enum DescribeWorkerDeploymentResponse: type: object properties: @@ -12355,14 +12390,14 @@ components: Update to queue-wide rate limit. If not set, this configuration is unchanged. NOTE: A limit set by the worker is overriden; and restored again when reset. - It must be less than or equal to the system-level setting at the time - of the request. If null, removes the existing rate limit. + If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit. updateFairnessKeyRateLimitDefault: allOf: - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' description: |- Update to the default fairness key rate limit. If not set, this configuration is unchanged. + If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit. UpdateTaskQueueConfigRequest_RateLimitUpdate: type: object properties: diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index 656f4086f..192c1d75b 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -106,11 +106,3 @@ enum WorkerStatus { WORKER_STATUS_SHUTTING_DOWN = 2; WORKER_STATUS_SHUTDOWN = 3; } - -// Source for the update -enum Source { - SOURCE_UNSPECIFIED = 0; - SOURCE_API = 1; - SOURCE_WORKER = 2; - SOURCE_SYSTEM = 3; -} diff --git a/temporal/api/enums/v1/task_queue.proto b/temporal/api/enums/v1/task_queue.proto index e0d642914..3e6efd6de 100644 --- a/temporal/api/enums/v1/task_queue.proto +++ b/temporal/api/enums/v1/task_queue.proto @@ -89,3 +89,14 @@ enum DescribeTaskQueueMode { // Enhanced mode reports aggregated results for all partitions, supports Build IDs, and reports richer info. DESCRIBE_TASK_QUEUE_MODE_ENHANCED = 1; } + +// Source for the effective rate limit. +enum RateLimitSource { + RATE_LIMIT_SOURCE_UNSPECIFIED = 0; + // The value was set by the API. + RATE_LIMIT_SOURCE_API = 1; + // The value was set by a worker. + RATE_LIMIT_SOURCE_WORKER = 2; + // The values was set as the system default. + RATE_LIMIT_SOURCE_SYSTEM = 3; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index fc3fe3aa5..3e6fa7d23 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1058,8 +1058,8 @@ message DescribeTaskQueueRequest { // Report stats for the requested task queue type(s). bool report_stats = 8; - // Show Task Queue Config - bool show_task_queue_config = 11; + // Report Task Queue Config + bool report_task_queue_config = 11; // Deprecated, use `report_stats` instead. // If true, the task queue status will be included in the response. @@ -1108,11 +1108,21 @@ message DescribeTaskQueueResponse { // Statistics for the task queue. Only populated when `report_stats` is set to true in the request. temporal.api.taskqueue.v1.TaskQueueStats stats = 5; - // Only populated if show_task_queue_config is set to true. + // Only populated if report_task_queue_config is set to true. temporal.api.taskqueue.v1.TaskQueueConfig config = 6; - // Source of the update - temporal.api.enums.v1.Source source = 7; + message EffectiveRateLimit { + // The effective rate limit for the task queue. + float queue_rate_limit_rps = 1; + + // Source of the RateLimit Configuration,which can be one of the following values: + // - SOURCE_API: The rate limit that is set via the TaskQueueConfig api. + // - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond. + // - SOURCE_SYSTEM: The rate limit is the default value set by the system + temporal.api.enums.v1.RateLimitSource rate_limit_source = 2; + } + + EffectiveRateLimit effective_rate_limit = 7; // Deprecated. // Status of the task queue. Only populated when `include_task_queue_status` is set to true in the request. @@ -2445,11 +2455,11 @@ message UpdateTaskQueueConfigRequest { // Update to queue-wide rate limit. // If not set, this configuration is unchanged. // NOTE: A limit set by the worker is overriden; and restored again when reset. - // It must be less than or equal to the system-level setting at the time - // of the request. If null, removes the existing rate limit. + // If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit. RateLimitUpdate update_queue_rate_limit = 5; // Update to the default fairness key rate limit. // If not set, this configuration is unchanged. + // If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit. RateLimitUpdate update_fairness_key_rate_limit_default = 6; } diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 25d411a8a..cde8cd58d 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1201,10 +1201,10 @@ service WorkflowService { // If the overall queue rate limit is unset, the worker-set rate limit takes effect. rpc UpdateTaskQueueConfig (UpdateTaskQueueConfigRequest) returns (UpdateTaskQueueConfigResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" + post: "/namespaces/{namespace}/task-queues/{task_queue_name}/update-config/{task_queue_type}" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" + post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue_name}/update-config/{task_queue_type}" body: "*" } }; From 084b4f3510bb12e6bf79f4ed85f1c7dff62a03e1 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Mon, 30 Jun 2025 16:22:33 -0700 Subject: [PATCH 15/18] Comment update --- openapi/openapiv2.json | 2 +- temporal/api/enums/v1/task_queue.proto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 9867c7c99..d96bc5145 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -12935,7 +12935,7 @@ "RATE_LIMIT_SOURCE_SYSTEM" ], "default": "RATE_LIMIT_SOURCE_UNSPECIFIED", - "description": "Source for the effective rate limit.\n\n - RATE_LIMIT_SOURCE_API: The value was set by the API.\n - RATE_LIMIT_SOURCE_WORKER: The value was set by a worker.\n - RATE_LIMIT_SOURCE_SYSTEM: The values was set as the system default." + "description": "Source for the effective rate limit.\n\n - RATE_LIMIT_SOURCE_API: The value was set by the API.\n - RATE_LIMIT_SOURCE_WORKER: The value was set by a worker.\n - RATE_LIMIT_SOURCE_SYSTEM: The value was set as the system default." }, "v1RecordActivityTaskHeartbeatByIdResponse": { "type": "object", diff --git a/temporal/api/enums/v1/task_queue.proto b/temporal/api/enums/v1/task_queue.proto index 3e6efd6de..7ddb8ebd6 100644 --- a/temporal/api/enums/v1/task_queue.proto +++ b/temporal/api/enums/v1/task_queue.proto @@ -97,6 +97,6 @@ enum RateLimitSource { RATE_LIMIT_SOURCE_API = 1; // The value was set by a worker. RATE_LIMIT_SOURCE_WORKER = 2; - // The values was set as the system default. + // The value was set as the system default. RATE_LIMIT_SOURCE_SYSTEM = 3; } From 17928870a5472870248e3bfe56e8ebb4af6802f4 Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Mon, 30 Jun 2025 16:37:10 -0700 Subject: [PATCH 16/18] Changed the effectiveRateLimit field name to requestsPerSecond --- openapi/openapiv2.json | 2 +- openapi/openapiv3.yaml | 2 +- temporal/api/workflowservice/v1/request_response.proto | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index d96bc5145..cdd72d384 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -7065,7 +7065,7 @@ "DescribeTaskQueueResponseEffectiveRateLimit": { "type": "object", "properties": { - "queueRateLimitRps": { + "requestsPerSecond": { "type": "number", "format": "float", "description": "The effective rate limit for the task queue." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 497db01e0..e752f7604 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7667,7 +7667,7 @@ components: DescribeTaskQueueResponse_EffectiveRateLimit: type: object properties: - queueRateLimitRps: + requestsPerSecond: type: number description: The effective rate limit for the task queue. format: float diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 3e6fa7d23..f213747c6 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1113,7 +1113,7 @@ message DescribeTaskQueueResponse { message EffectiveRateLimit { // The effective rate limit for the task queue. - float queue_rate_limit_rps = 1; + float requests_per_second = 1; // Source of the RateLimit Configuration,which can be one of the following values: // - SOURCE_API: The rate limit that is set via the TaskQueueConfig api. From 2f0f40f94d9f217049d2b2263db314f998232deb Mon Sep 17 00:00:00 2001 From: sivagirish81 <35769591+sivagirish81@users.noreply.github.com> Date: Wed, 2 Jul 2025 21:37:33 -0700 Subject: [PATCH 17/18] Incorporated review comments. --- openapi/openapiv2.json | 35 ++++--------------- openapi/openapiv3.yaml | 30 +++------------- .../workflowservice/v1/request_response.proto | 2 +- temporal/api/workflowservice/v1/service.proto | 4 +-- 4 files changed, 14 insertions(+), 57 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index cdd72d384..339175c47 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1530,7 +1530,7 @@ "type": "boolean" }, { - "name": "reportTaskQueueConfig", + "name": "reportConfig", "description": "Report Task Queue Config", "in": "query", "required": false, @@ -1617,7 +1617,7 @@ ] } }, - "/api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config/{taskQueueType}": { + "/api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { "post": { "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", "operationId": "UpdateTaskQueueConfig2", @@ -1649,18 +1649,6 @@ "required": true, "type": "string" }, - { - "name": "taskQueueType", - "in": "path", - "required": true, - "type": "string", - "enum": [ - "TASK_QUEUE_TYPE_UNSPECIFIED", - "TASK_QUEUE_TYPE_WORKFLOW", - "TASK_QUEUE_TYPE_ACTIVITY", - "TASK_QUEUE_TYPE_NEXUS" - ] - }, { "name": "body", "in": "body", @@ -5242,7 +5230,7 @@ "type": "boolean" }, { - "name": "reportTaskQueueConfig", + "name": "reportConfig", "description": "Report Task Queue Config", "in": "query", "required": false, @@ -5329,7 +5317,7 @@ ] } }, - "/namespaces/{namespace}/task-queues/{taskQueueName}/update-config/{taskQueueType}": { + "/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { "post": { "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", "operationId": "UpdateTaskQueueConfig", @@ -5361,18 +5349,6 @@ "required": true, "type": "string" }, - { - "name": "taskQueueType", - "in": "path", - "required": true, - "type": "string", - "enum": [ - "TASK_QUEUE_TYPE_UNSPECIFIED", - "TASK_QUEUE_TYPE_WORKFLOW", - "TASK_QUEUE_TYPE_ACTIVITY", - "TASK_QUEUE_TYPE_NEXUS" - ] - }, { "name": "body", "in": "body", @@ -8643,6 +8619,9 @@ "identity": { "type": "string" }, + "taskQueueType": { + "$ref": "#/definitions/v1TaskQueueType" + }, "updateQueueRateLimit": { "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", "description": "Update to queue-wide rate limit.\nIf not set, this configuration is unchanged.\nNOTE: A limit set by the worker is overriden; and restored again when reset.\nIf the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index e752f7604..cfbe83dde 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1300,7 +1300,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config/{taskQueueType}: + /api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config: post: tags: - WorkflowService @@ -1322,17 +1322,6 @@ paths: required: true schema: type: string - - name: taskQueueType - in: path - required: true - schema: - enum: - - TASK_QUEUE_TYPE_UNSPECIFIED - - TASK_QUEUE_TYPE_WORKFLOW - - TASK_QUEUE_TYPE_ACTIVITY - - TASK_QUEUE_TYPE_NEXUS - type: string - format: enum requestBody: content: application/json: @@ -1485,7 +1474,7 @@ paths: description: Report stats for the requested task queue type(s). schema: type: boolean - - name: reportTaskQueueConfig + - name: reportConfig in: query description: Report Task Queue Config schema: @@ -4628,7 +4617,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/task-queues/{taskQueueName}/update-config/{taskQueueType}: + /namespaces/{namespace}/task-queues/{taskQueueName}/update-config: post: tags: - WorkflowService @@ -4650,17 +4639,6 @@ paths: required: true schema: type: string - - name: taskQueueType - in: path - required: true - schema: - enum: - - TASK_QUEUE_TYPE_UNSPECIFIED - - TASK_QUEUE_TYPE_WORKFLOW - - TASK_QUEUE_TYPE_ACTIVITY - - TASK_QUEUE_TYPE_NEXUS - type: string - format: enum requestBody: content: application/json: @@ -4813,7 +4791,7 @@ paths: description: Report stats for the requested task queue type(s). schema: type: boolean - - name: reportTaskQueueConfig + - name: reportConfig in: query description: Report Task Queue Config schema: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index f213747c6..139a609f3 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1059,7 +1059,7 @@ message DescribeTaskQueueRequest { bool report_stats = 8; // Report Task Queue Config - bool report_task_queue_config = 11; + bool report_config = 11; // Deprecated, use `report_stats` instead. // If true, the task queue status will be included in the response. diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index cde8cd58d..25d411a8a 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1201,10 +1201,10 @@ service WorkflowService { // If the overall queue rate limit is unset, the worker-set rate limit takes effect. rpc UpdateTaskQueueConfig (UpdateTaskQueueConfigRequest) returns (UpdateTaskQueueConfigResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/task-queues/{task_queue_name}/update-config/{task_queue_type}" + post: "/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue_name}/update-config/{task_queue_type}" + post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" body: "*" } }; From 339b66df270fe5c79381ad1b8b01b39feb4d991e Mon Sep 17 00:00:00 2001 From: sivagirish81 Date: Mon, 7 Jul 2025 15:36:31 -0700 Subject: [PATCH 18/18] Renamed task_queue_name to task_queue to ensure consistency for routing --- openapi/openapiv2.json | 8 ++++---- openapi/openapiv3.yaml | 10 +++++----- temporal/api/workflowservice/v1/request_response.proto | 2 +- temporal/api/workflowservice/v1/service.proto | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 68afcf767..3fc7f35d4 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1617,7 +1617,7 @@ ] } }, - "/api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { + "/api/v1/namespaces/{namespace}/task-queues/{taskQueue}/update-config": { "post": { "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", "operationId": "UpdateTaskQueueConfig2", @@ -1643,7 +1643,7 @@ "type": "string" }, { - "name": "taskQueueName", + "name": "taskQueue", "description": "Selects the task queue to update.", "in": "path", "required": true, @@ -5317,7 +5317,7 @@ ] } }, - "/namespaces/{namespace}/task-queues/{taskQueueName}/update-config": { + "/namespaces/{namespace}/task-queues/{taskQueue}/update-config": { "post": { "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", "operationId": "UpdateTaskQueueConfig", @@ -5343,7 +5343,7 @@ "type": "string" }, { - "name": "taskQueueName", + "name": "taskQueue", "description": "Selects the task queue to update.", "in": "path", "required": true, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index dcf97b5f6..3b9718880 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1300,7 +1300,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/task-queues/{taskQueueName}/update-config: + /api/v1/namespaces/{namespace}/task-queues/{taskQueue}/update-config: post: tags: - WorkflowService @@ -1316,7 +1316,7 @@ paths: required: true schema: type: string - - name: taskQueueName + - name: taskQueue in: path description: Selects the task queue to update. required: true @@ -4617,7 +4617,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/task-queues/{taskQueueName}/update-config: + /namespaces/{namespace}/task-queues/{taskQueue}/update-config: post: tags: - WorkflowService @@ -4633,7 +4633,7 @@ paths: required: true schema: type: string - - name: taskQueueName + - name: taskQueue in: path description: Selects the task queue to update. required: true @@ -12352,7 +12352,7 @@ components: type: string identity: type: string - taskQueueName: + taskQueue: type: string description: Selects the task queue to update. taskQueueType: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 5deaf04a8..562535721 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2450,7 +2450,7 @@ message UpdateTaskQueueConfigRequest { string namespace = 1; string identity = 2; // Selects the task queue to update. - string task_queue_name = 3; + string task_queue = 3; temporal.api.enums.v1.TaskQueueType task_queue_type = 4; // Update to queue-wide rate limit. // If not set, this configuration is unchanged. diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 25d411a8a..eb78ead74 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1201,10 +1201,10 @@ service WorkflowService { // If the overall queue rate limit is unset, the worker-set rate limit takes effect. rpc UpdateTaskQueueConfig (UpdateTaskQueueConfigRequest) returns (UpdateTaskQueueConfigResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" + post: "/namespaces/{namespace}/task-queues/{task_queue}/update-config" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue_name}/update-config" + post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue}/update-config" body: "*" } };