Add option to set max_receive_message_length in client config#55
Conversation
hughmiao
left a comment
There was a problem hiding this comment.
thanks for the PR, Keshi. some nit comments.
|
|
||
| // Maximum message length that the channel can receive. | ||
| optional int64 max_receive_message_length = 4; |
There was a problem hiding this comment.
let's create a message, e.g., GrpcChannelArguments, and use that in the MetadataStoreClientConfig as well as the MetadataStoreServerConfig too. The server needs to be aware of argument as well, correct? also having a message, helps to extend to support other channel options. wdyt?
There was a problem hiding this comment.
consider to build the custom server and try the client change to see whether this fixes your issue?
There was a problem hiding this comment.
sounds good! @hughmiao, I'll work more on this PR later this week.
There was a problem hiding this comment.
@hughmiao sorry for the delay. I added GrpcChannelArguments message to handle max_receive_message_length grpc option. MetadataStoreServerConfig should be fine since it's already been parsing grpc arguments (
I also tested it locally and it worked as expected. Please take another look and let me know if it's good to go. Thank you!
In [1]: from ml_metadata.proto import metadata_store_pb2
...: import ml_metadata as mlmd
...: metadata_connection_config = metadata_store_pb2.MetadataStoreClientConfig()
...: metadata_connection_config.host = "127.0.0.1"
...: metadata_connection_config.port = 8080
...: metadata_connection_config.channel_arguments.max_receive_message_length = 0
...: store = mlmd.MetadataStore(metadata_connection_config)
...: store.get_artifact_types()
...
...
~/Projects/google/ml-metadata/ml_metadata/metadata_store/metadata_store.py in _call_method(self, method_name, request, response)
172 # description.
173 # https://grpc.github.io/grpc/python/_modules/grpc.html#StatusCode
--> 174 raise _make_exception(e.details(), e.code().value[0]) # pytype: disable=attribute-error
175
176 def _swig_call(self, method, request, response) -> None:
ResourceExhaustedError: Received message larger than max (3583 vs. 0)
d6dccc7 to
ec7cc1c
Compare
Fixes #42