首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当流调用循环大时,Grpc双向流被对等端终止?

当流调用循环大时,Grpc双向流被对等端终止?
EN

Stack Overflow用户
提问于 2021-01-23 08:04:08
回答 1查看 883关注 0票数 1

我在客户端(dart)和服务器(.net)之间有双向流。当客户端有大的流调用循环时,我遇到了问题。

在服务器上

代码语言:javascript
复制
System.IO.IOException: The request stream was aborted.
---> Microsoft.AspNetCore.Connections.ConnectionAbortedException: The HTTP/2 connection faulted.
  --- End of inner exception stack trace ---
  at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
  at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
  at System.IO.Pipelines.Pipe.GetReadAsyncResult()
  at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2MessageBody.ReadAsync(CancellationToken cancellationToken)
  at Grpc.AspNetCore.Server.Internal.PipeExtensions.ReadStreamMessageAsync[T](PipeReader input, HttpContextServerCallContext serverCallContext, Func`2 deserializer, CancellationToken cancellationToken)

在客户身上我得到了

代码语言:javascript
复制
gRPC Error (code: 2, codeName: UNKNOWN, message: HTTP/2 error: Stream error: Stream was terminated by peer (errorCode: 2)., details: null)

它的工作时,小流调用循环。

我试着增加MaxStreamsPerConnection,但仍然不起作用

代码语言:javascript
复制
.ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.ConfigureKestrel(serveroption => {
        
                        serveroption.Limits.Http2.MaxStreamsPerConnection = 5000;
                    }).UseStartup<Startup>();
                });
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-23 12:56:07

我的应用程序使用nginx作为反向代理。这是来自nginx webserver的问题。我从nginx得到的错误

客户端打算发送太大的块体:向上游发送请求时发送10489464字节,

要解决这个问题,只需添加

代码语言:javascript
复制
http {
    ...
    client_max_body_size 20M;
}   

Nginx error: client intended to send too large body

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65857026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档