Skip to content

Commit 142a2d5

Browse files
author
Martin Kosiba
committed
review feedback
1 parent 503aae4 commit 142a2d5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pkg/proto/remoteactionrouter/remoteactionrouter.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ message RouteActionRequest {
2424

2525
message RouteActionResponse {
2626
// The updated action.
27-
// Remote action router implementations can modify any field, though the
28-
// most commonly only modifying Platform properties are modified.
27+
// Remote action router implementations can modify any field, though usually
28+
// only Platform properties are modified.
2929
build.bazel.remote.execution.v2.Action action = 1;
3030

3131
// Invocation keys used for fairness grouping, the first key in the array is

pkg/scheduler/routing/remote_action_router.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ type remoteActionRouter struct {
1919
initialSizeClassAnalyzer initialsizeclass.Analyzer
2020
}
2121

22-
// NewRemoteActionRouter creates an ActionRouter that delegates routing decisions to a remote gRPC service.
23-
// Initial size class selection is performed locally using the provided analyzer.
22+
// NewRemoteActionRouter creates an ActionRouter that delegates routing
23+
// decisions to a remote gRPC service. Initial size class selection is
24+
// performed locally using the provided analyzer.
2425
func NewRemoteActionRouter(client remoteactionrouter.ActionRouterClient, initialSizeClassAnalyzer initialsizeclass.Analyzer) ActionRouter {
2526
return &remoteActionRouter{
2627
client: client,
@@ -49,7 +50,7 @@ func (ar *remoteActionRouter) RouteAction(ctx context.Context, digestFunction di
4950

5051
platformKey, err := platform.NewKey(digestFunction.GetInstanceName(), action.Platform)
5152
if err != nil {
52-
return nil, platform.Key{}, nil, nil, status.Error(codes.Internal, "Malformed platform in remote action router response")
53+
return nil, platform.Key{}, nil, nil, util.StatusWrapWithCode(err, status.Error(codes.Internal, "Malformed platform in remote action router response"))
5354
}
5455

5556
if len(response.InvocationKeys) == 0 {
@@ -59,7 +60,7 @@ func (ar *remoteActionRouter) RouteAction(ctx context.Context, digestFunction di
5960
for _, anyKey := range response.InvocationKeys {
6061
invocationKey, err := invocation.NewKey(anyKey)
6162
if err != nil {
62-
return nil, platform.Key{}, nil, nil, status.Error(codes.Internal, "Malformed invocation key in remote action router response")
63+
return nil, platform.Key{}, nil, nil, util.StatusWrapWithCode(err, status.Error(codes.Internal, "Malformed invocation key in remote action router response"))
6364
}
6465
invocationKeys = append(invocationKeys, invocationKey)
6566
}

0 commit comments

Comments
 (0)