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

limit is not used in get_range_request of 0.12.0 #1716

Open
fly-studio opened this issue Oct 13, 2021 · 3 comments
Open

limit is not used in get_range_request of 0.12.0 #1716

fly-studio opened this issue Oct 13, 2021 · 3 comments

Comments

@fly-studio
Copy link

fly-studio commented Oct 13, 2021

I want to read the last revision of a key with prefix

response = etcd.get_prefix_response(settings.CONF_PREFIX, sort_order='descend', sort_target='mod', limit=1)
print(response.header.revision)

but report grpc body is greater then 4M when key/value is big in etcd

Received_message larger than max(4194304)  

This problem occurs because limit is not used in the body of _build_get_range_request,
but fix in the master branch, When will the next stable release be?

@mangox
Copy link

mangox commented May 5, 2022

I'm facing this issue too.

@mangox
Copy link

mangox commented May 5, 2022

I have solved this issue by setting grpc options.
etcd3.client(host=host, port=port, grpc_options={'grpc.max_receive_message_length': -1, 'grpc.max_send_message_length': -1})

@kimitoboku
Copy link

I have solved as following setting.
etcd3.client(host=host, port=port, grpc_options=[('grpc.max_receive_message_length', -1), ('grpc.max_send_message_length', -1)])

grpc_options is parsed as a list of the key-value tuples.
https://github.com/grpc/grpc/blob/066a310df1fe9d68a00f346bd36e6c965d62e528/src/python/grpcio/grpc/_channel.py#L1450-L1460

'grpc.max_receive_message_length: https://grpc.github.io/grpc/core/group__grpc__arg__keys.html#ga813f94f9ac3174571dd712c96cdbbdc1

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

3 participants