Skip to content

Conversation

ychebotarev
Copy link
Contributor

@ychebotarev ychebotarev commented Jul 24, 2025

What changed?
Add payloads for worker commands:
FetchWorkerConfig
UpdateWorkerConfig

Also add DescribeWorker API.

Why?
payloads - we need to align with SDK on command payload schemas.

DescribeWorker - will be needed to get all the heartbeat information from the worker.
Partially this can be covered by "ListWorkers" with query "WorkerInstanceKey = 'xxx'", but this is a dedicated API that doesn't require query processing.

Breaking changes
Yes (new API)

Server PR

@ychebotarev ychebotarev requested review from a team as code owners July 24, 2025 00:40
@ychebotarev ychebotarev requested review from cretz and yuandrew July 24, 2025 16:41
// Will be send to the worker as a payload of the UpdateWorkerConfig command.
message UpdateWorkerConfigCommandPayload {
// Worker identifier, should be unique for the namespace.
repeated string worker_instance_key = 1;
Copy link
Member

@cretz cretz Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To confirm, you can only update worker config if the server knows about the worker. So if you say "update worker config for every worker on X process", if a specific worker on that process hasn't heartbeat, it doesn't get the update? I think this is probably ok, just want to confirm that is the expected behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it doesn't get an update.
But that will be very weird situation - heartbeats are coming via the same nexus poll request...

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM. Only wanting to wait for approval pending the server and ideally SDK use of this (basically can we have both just referencing this branch while they develop this new Nexus service?)

Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree w/ Chad that let's not merge this until we have something working in branches w/ both your and Andrew's code

ychebotarev added a commit that referenced this pull request Jul 25, 2025
<!-- Describe what has changed in this PR -->
**What changed?**
Add DescribeWorker API.
Extracted from [this PR](#622). 

<!-- Tell your future self why have you made these changes -->
DescribeWorker - will be needed to get all the heartbeat information
from the worker.
Partially this can be covered by "ListWorkers" with query
"WorkerInstanceKey = 'xxx'", but this is a dedicated API that doesn't
require query processing.

Extracting into separate PR so that one is concentrated on worker
payload only.

<!-- Are there any breaking changes on binary or code level? -->
**Breaking changes**
Introduce new API

<!-- If this breaks the Server, please provide the Server PR to merge
right after this PR was merged. -->
[Server PR](temporalio/temporal#8094)
temporal-cicd bot pushed a commit to temporalio/api-go that referenced this pull request Jul 25, 2025
<!-- Describe what has changed in this PR -->
**What changed?**
Add DescribeWorker API.
Extracted from [this PR](temporalio/api#622).

<!-- Tell your future self why have you made these changes -->
DescribeWorker - will be needed to get all the heartbeat information
from the worker.
Partially this can be covered by "ListWorkers" with query
"WorkerInstanceKey = 'xxx'", but this is a dedicated API that doesn't
require query processing.

Extracting into separate PR so that one is concentrated on worker
payload only.

<!-- Are there any breaking changes on binary or code level? -->
**Breaking changes**
Introduce new API

<!-- If this breaks the Server, please provide the Server PR to merge
right after this PR was merged. -->
[Server PR](temporalio/temporal#8094)
ychebotarev added a commit to temporalio/temporal that referenced this pull request Jul 25, 2025
## What changed?
* Add implementation for DescribeWorker API (to both frontend and
matching)
* Add feature flag
* Add all quotas/etc.
* Add unit tests
* Add functional tests

## Why?

Part of worker commands work. 
Users should be able to directly get worker info for the worker they
need.
Corresponding API PR: temporalio/api#622

## How did you test it?
- [X] add unit tests
- [X] add functional tests

## Potential risks
None, behind feature flag
// --)

// Will be sent to the worker as a payload of the FetchWorkerConfig command.
message FetchWorkerConfigRequest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like it's a little confusing that these are named the exact same name as the request they're used for, could we differentiate them slightly? Maybe add in Command, Payload, or Nexus into the name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need "Request/Response" pair. "Command" is fine for "Request", but what about "Response"?
Or you mean we should name them

FetchWorkerConfigCommand[Request/Resonse] ? If so I'm fine with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or FetchWorkerConfig[Request|Response]Payload? Which is exactly what it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants