Skip to content
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

Allow configuring max_encoding_message_size and max_decoding_message_size for general Client creation #88

Open
ludwigschlame opened this issue Jan 17, 2025 · 3 comments

Comments

@ludwigschlame
Copy link

ludwigschlame commented Jan 17, 2025

Hi there,
I noticed, that with release v0.11.0 the version of tonic was bumped to 0.9.x, which introduced a default limit for the maximum size of gRPC messages able to be received (4 MB).
Since the amount of data we read with a single request is much larger than this, we are currently unable to update our etcd-client dependency.

I saw that you made this limit configurable for KvClients and WatchClients in v0.12.2.
However, I can't seem to find a way to modify these limits when creating a general Client.
Am I missing something or is it currently not possible to overwrite these limits?

Do you think it would make sense to expose these settings through the ConnectOptions?
If so, I’ve prepared a draft for this feature, and I’d appreciate your feedback:
https://github.com/ludwigschlame/etcd-client/tree/message-size-options

@davidli2010
Copy link
Contributor

please use clent.kv_client().max_decoding_message_size()

@ludwigschlame
Copy link
Author

Hi, thank you for the response!
If I understand correctly, your proposed solution works for manually creating a kv client like so:

let mut kv = client.kv_client().max_decoding_message_size(usize::MAX);
let data = kv.get([...]).await?;

However, it does not allow me to modify the kv client inside the Client struct as it is not exposed mutably.
As a result, I would have to create a modified kv client at every location it is used which, while possible, is not very convenient.
Is this setting not intended to be permanently overwritten?

@davidli2010
Copy link
Contributor

clent.kv_client() shares the same underlying channel with kv client inside the Client, it is just a clone of Arc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants