英文:
grpc: received message larger than max (4623947 vs. 4194304)
问题
请帮助我
我已经尝试了一切
GRPC的设置都已经指定了,他还需要我提供什么?
// client
sock, err := grpc.Dial(
config.Parser,
grpc.WithInsecure(),
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(20*1024*1024),
grpc.MaxCallSendMsgSize(20*1024*1024)))
//...
m, err := d.Parser.UpdateSources(
ctx,
movie,
grpc.MaxCallSendMsgSize(10*1024*1024),
grpc.MaxCallRecvMsgSize(10*1024*1024))
GRPC仍然报告消息过大的问题,从错误信息可以看出,设置没有生效
我还在服务器上添加了选项
rpc := grpc.NewServer(
grpc.MaxSendMsgSize(1024*1024*20),
grpc.MaxSendMsgSize(1024*1024*20))
结果
>rpc错误:code = ResourceExhausted desc = grpc:接收到的消息大于最大值(4623947 vs. 4194304)
GRPC版本为v1.41.0
英文:
Please help me
I've tried everything already
The grps settings are all indicated what else he requires from me
// client
sock, err := grpc.Dial(
config.Parser,
grpc.WithInsecure(),
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(20*1024*1024),
grpc.MaxCallSendMsgSize(20*1024*1024)))
//...
m, err := d.Parser.UpdateSources(
ctx,
movie,
grpc.MaxCallSendMsgSize(10*1024*1024),
grpc.MaxCallRecvMsgSize(10*1024*1024))
grps still swears at a large message and, as you can see from the error, the settings were not applied
I also added options on the server
rpc := grpc.NewServer(
grpc.MaxSendMsgSize(1024*1024*20),
grpc.MaxSendMsgSize(1024*1024*20))
result
>rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4623947 vs. 4194304)
version grpc v1.41.0
答案1
得分: 2
问题已经解决。
我忘记设置 grpc.MaxRecvMsgSize(1024*1024*20)
。
我在服务器端写了两次 grpc.MaxSendMsgSize(1024*1024*20)
。
因为一个小错误整夜都浪费了。
英文:
The problem has been resolved.
i missed setting grpc.MaxRecvMsgSize(1024*1024*20)
I wrote twice grpc.MaxSendMsgSize(1024*1024*20)
in server.
Lost all night due to a minor bug(
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论