WIP: rpc/client: Allow to pass custom grpc.CallOption options #124
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-api-go#124
Loading…
Reference in a new issue
No description provided.
Delete branch "a-savchuk/frostfs-api-go:grpc-call-options"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Aleksey Savchuk a.savchuk@yadro.com
lint-install
target e7d9c772bdgrpc.CallOption
options2af8c4a1fc
to3893ca67ac
grpc.CallOption
options on dial #287@ -56,3 +56,3 @@
ServerStreams: info.ServerStream(),
ClientStreams: info.ClientStream(),
}, toMethodName(info))
}, toMethodName(info), c.grpcCallOpts...)
These are the call options to be passed to every method?
In this case let's use
default
word everywhere in names (WithDefaultGRPCCallOptions
).An we already have
opts ...CallOption
in this function, so this is doubly confusing.Our
CallOption
s don't usegrpc.CallOption
underneath. As I see, you use them only while opening a new connection. I'll consider if we can combine themfunc SendUnary(cli *Client, info common.CallMethodInfo, req, resp message.Message, opts ...CallOption) error {
rw, err := cli.Init(info, opts...)
func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageReadWriter, error) {
prm := defaultCallParameters()
for _, opt := range opts {
opt(prm)
}
if err := c.openGRPCConn(prm.ctx, prm.dialer); err != nil {
return nil, err
}
@ -24,6 +24,7 @@ type cfg struct {
tlsCfg *tls.Config
grpcDialOpts []grpc.DialOption
grpcCallOpts []grpc.CallOption
What is the usecase?
It's WIP yet. I was going to describe entire solution later. In short. I'd like to pass
grpc.WaitForReady(true)
to a client to make it wait for a deadline.Please, no links to anything unaccessible to a general public.
For every call? I think the default behaviour makes sense for some calls. Also, what is the timeout we wait for without this option?
Found a simpler solution, please see TrueCloudLab/frostfs-node#1441
Pull request closed