Repository navigation
Implement dynamic worker-type queue routing for heavy targets - #364
Merged
Merged
Conversation
peterebden
reviewed
Oct 17, 2026
Comment on lines
+400
to
+401
| log.Warningf("Failed to read action for worker-type routing, falling back to standard: %s", err) | ||
| topic = s.requests[defaultRequestQueue] |
Member
There was a problem hiding this comment.
I expect if we get here the action is doomed, so you could just bail. This is fine too though.
Hamishpk
reviewed
Oct 19, 2026
| log.Warningf("Failed to read action for worker-type routing, falling back to standard: %s", err) | ||
| topic = s.requests[defaultRequestQueue] | ||
| } else if t, ok := s.requests[workerType]; ok { | ||
| log.Infof("Routing action %s to worker-type queue: %s", req.ActionDigest.Hash, workerType) |
Contributor
There was a problem hiding this comment.
We probably want to make these debug logs, there will be lots of them
| defer cancel() | ||
| if err := s.requests.Send(ctx, &pubsub.Message{ | ||
|
|
||
| workerType, err := s.getWorkerType(req) |
Contributor
There was a problem hiding this comment.
We have a validatePlatform() function on line 342. Is it worth combining these to keep them in line. Currently if we have multiple worker queues and don't add the worker-type to allowed platform properties we will fail before we get here
jamespitt
force-pushed
the
heavymettle
branch
3 times, most recently
from
October 19, 2026 09:08
9918ef7 to
c1881bf
Compare
peterebden
approved these changes
Oct 22, 2026
peterebden
left a comment
Member
There was a problem hiding this comment.
Thanks!
Also just spotted the branch name 🤘
jamespitt
force-pushed
the
heavymettle
branch
2 times, most recently
from
October 23, 2026 13:34
06cda8d to
f899069
Compare
This adds support for passing multiple request queues to the Mettle API server, and dynamically routing incoming ExecuteRequests based on the 'worker-type' platform property found in the Action digest. Unrouted or missing properties safely fall back to the standard queue. Includes full unit test coverage for the new routing logic in api_test.go.
jamespitt
force-pushed
the
heavymettle
branch
from
October 23, 2026 13:35
f899069 to
0af02e8
Compare
Hamishpk
approved these changes
Oct 23, 2026
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.
This adds support for passing multiple request queues to the Mettle API server, and dynamically routing incoming ExecuteRequests based on the 'worker-type' platform property found in the Action digest. Unrouted or missing properties safely fall back to the standard queue.
Includes full unit test coverage for the new routing logic in api_test.go.