Repository navigation
Report poller target on poll requests and in the worker heartbeat - #887
Open
veeral-patel wants to merge 7 commits into
Open
veeral-patel wants to merge 7 commits into
veeral-patel wants to merge 7 commits into
Conversation
Workers report the poller target of the pool issuing each poll so the server can distribute poller-scaling suggestions fairly across a fleet. Scaling suggestions ride on dispatched tasks and the matcher is FIFO, so a worker's share of suggestions tracks its share of pollers. Growth is therefore proportional to current size, which preserves any imbalance between otherwise identical workers rather than correcting it. With a reported target the server can withhold suggestions that would push a worker further from its share.
This was referenced Oct 20, 2026
Sushisource
reviewed
Oct 20, 2026
Comment on lines
+39
to
+44
| // Scaling suggestions ride on dispatched tasks, and the matcher hands tasks to waiting | ||
| // pollers in FIFO order, so a worker holding a large share of a task queue's pollers | ||
| // receives suggestions at a proportionally higher rate. That makes poller growth | ||
| // proportional to current poller count, which preserves and amplifies any imbalance | ||
| // between otherwise identical workers. Reporting this lets the server withhold | ||
| // suggestions that would push a worker further from its share. |
Member
There was a problem hiding this comment.
I dunno that this needs to go into detail about the specific motivating problem. Can probably just drop the whole paragraph honestly.
Co-authored-by: Spencer Judge <spencer@temporal.io>
veeral-patel
marked this pull request as ready for review
October 20, 2026 20:11
Workers already report their poller target on each poll so matching can spread scaling suggestions across a fleet by share. That value is consumed inside the matching decision and discarded -- nothing persists it, and nothing can observe it. Reporting it on the heartbeat as well lets the server read poller target per worker and export it as a metric, making fleet-wide poller distribution visible without instrumenting every SDK. WorkerHeartbeat already carries four separate WorkerPollerInfo sub-messages (workflow, sticky workflow, activity, nexus), so a single field here gives a per-task-type breakdown without a new keyed structure, and keeps the normal-vs-sticky split that TaskQueueType cannot express.
Drop the rich-get-richer explanation from PollerScalingInfo: it is rationale for the server's matching logic rather than anything a client needs to populate the field, and it will go stale independently of this proto. The rest just says less of the same thing, matching the one-to-two line style of the surrounding fields.
Sushisource
approved these changes
Oct 22, 2026
CI runs 'make ci-build' and fails if the tree is dirty, and the checked-in OpenAPI specs are generated output. WorkerHeartbeat is reachable over the HTTP API via RecordWorkerHeartbeat, so adding a field to WorkerPollerInfo changes them. The poll-request field needed no regeneration -- the poll RPCs have no HTTP binding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a worker-reported poller target in two places.
1. On each poll — a new
PollerScalingInfointemporal.api.taskqueue.v1, attached as field 11 toPollWorkflowTaskQueueRequestandPollActivityTaskQueueRequest:2. On the worker heartbeat — a new field on
WorkerPollerInfo:Why
Sending poller target in each poll will allow us to apply logic to load balance pollers between workers. Sending poller target on the worker heartbeat will let us export a poller target metric on the server side.