Set default Client.callOpts in NewCtxClient#21809
Conversation
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: brandond The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @brandond. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
It seems on purpose. Lines 95 to 97 in 8ad92a0 |
|
It says |
|
I am constructing my client like this: cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(endpoint, cfg.DialOptions...)
if err != nil {
return nil, nil, err
}
client := clientv3.NewCtxClient(ctx, clientv3.WithZapLogger(logger.Named("my-client")))
client.Cluster = clientv3.NewClusterFromClusterClient(etcdserverpb.NewClusterClient(conn), client)
client.KV = clientv3.NewKVFromKVClient(etcdserverpb.NewKVClient(conn), client)
client.Maintenance = clientv3.NewMaintenanceFromMaintenanceClient(etcdserverpb.NewMaintenanceClient(conn), client)
client.Watcher = clientv3.NewWatchFromWatchClient(etcdserverpb.NewWatchClient(conn), client)
As far as I can tell there is no way to override the callOpts in either Client or kv, so if they are left empty then large GRPC messages cannot be sent or received. |
|
/ok-to-test |
|
@brandond: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@brandond I was wondering, is there a specific reason for not invoking |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
... and 22 files with indirect coverage changes @@ Coverage Diff @@
## main #21809 +/- ##
==========================================
- Coverage 70.23% 70.07% -0.17%
==========================================
Files 426 427 +1
Lines 35245 35304 +59
==========================================
- Hits 24755 24739 -16
- Misses 9100 9165 +65
- Partials 1390 1400 +10 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
I want more direct control over the grpc connection, endpoint dialing, and error handling/retry behavior. Which is what NewCtxClient is for, I believe? |
clientv3.NewsetsClient.callOptstodefaultCallOptsinclientv3.newClient, butclientv3.NewCtxClientdoes not, and there is no other way to modify call options - so the default GRPC message sizes are used, which is not correct and makes it impossible to perform operations that require payloads larger than the default 4MB grpc message size.