python-3.x - 增加 GRPC 消息大小不起作用
问题描述
我正在发送超过 40 MB 的 grpc 消息,我在客户端和服务器端都设置了 grpc 消息大小的限制,如下所示以占用 64 MB 仍然收到大小限制错误?
客户
options = [('grpc.max_send_message_length', 64*1024*1024),
('grpc.max_receive_message_length', 64*1024*1024)]
channel = grpc.secure_channel(channel_endpoint, grpc.ssl_channel_credentials(), options)
服务器
choptions = [('grpc.max_send_message_length', 64*1024*1024),
('grpc.max_receive_message_length', 64*1024*1024)]
server = grpc.server(futures.ThreadPoolExecutor(max_workers=max_workers), options=choptions)
遇到错误:
status = StatusCode.RESOURCE_EXHAUSTED
details = "grpc: received message larger than max (4718167 vs. 4194304)
如何解决这个问题?
解决方案
从错误消息来看,它看起来来自 Go 服务器而不是 Python 服务器https://github.com/grpc/grpc-go/blob/670c133e568e89c901d05b898af9f5ce72a88c6d/rpc_util.go#L573而不是来自 Python 服务器的错误这将 - https://github.com/grpc/grpc/blob/6b916984a8b167d4bcf9c15e21090be49976ceaa/src/core/ext/filters/message_size/message_size_filter.cc#L206
要解决此问题,您还需要提高 Go 服务器的限制。
推荐阅读
- javascript - After Effects Slider 表达式以增加或减少可见层
- electron - buildResources 目录在哪里?
- python - 如何在单个单元格中垂直合并数据框中的所有行?
- python - 静音和取消静音功能
- android - 使用 Hilt 注入上下文:此字段泄漏上下文对象
- thrift - 如何安装 Apache thrift 0.13.0
- ffmpeg - 如何指定 .webm 转换的有损/无损程度(在 ffmpeg 中)?
- android - 如何修复 Android Studio 模拟器中的错误点击位置?
- python - 当一次通过一个时,Cartopy 在两极绘制额外的分数
- javascript - 将 eventListener 附加到单击另一个按钮时将出现的按钮?