-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(scheduler): implement and register block builder rpc service #15248
Conversation
panic("unimplemented") | ||
func (s *BlockScheduler) CompleteJob(_ context.Context, req *proto.CompleteJobRequest) (*proto.CompleteJobResponse, error) { | ||
s.queue.MarkComplete(req.Job.Id) | ||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should return non-nil response types to satisfy caller expectations even though they're basically empty structs.
}, | ||
}) | ||
|
||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should return non-nil response types to satisfy caller expectations even though they're basically empty structs.
@@ -70,7 +70,12 @@ func (t *GRPCTransport) SendGetJobRequest(ctx context.Context, req *GetJobReques | |||
BuilderId: req.BuilderID, | |||
} | |||
|
|||
resp, err := t.GetJob(ctx, protoReq) | |||
client, err := t.GetJob(ctx, protoReq) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think creating streaming clients for every RPC is any better than using the non-streaming RPCs we had prior. These are generally run in a loop
Some examples of how we generally use streaming methods. e.g.
https://grpc.io/docs/languages/go/basics/#defining-the-service is also a good resource It might be better to leave it as unary for now and dedicate a single PR to bidirectional streaming GRPC later |
What this PR does / why we need it:
BlockBuilderServiceServer
rpc interface and registered with grpc server.GetJob
is now a server-side streaming rpc which allows builders to wait on the server for pending jobs.JobQueue uses a cond var to wake up pending routines if there are any new pending jobsminor improvements:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR