"stream closed" error 13 for long simple RPC call

257 views
Skip to first unread message

Jediah Katz

unread,
Mar 9, 2021, 6:26:14 PM3/9/21
to grpc.io
Hi,

I have a simple service with one RPC, e.g.
rpc Foo (FooReq) returns (FooRes)

Now, calls to Foo can potentially take a very long time to process on the server (up to several minutes). However, when this happens, I get the following error:
%GRPC.RPCError{message: ":stream_error: :closed", status: 13}

We are planning on refactoring this service to be asynchronous, so that the client does not need to block on waiting for the server's response, but in the meantime we hope to fix this error. Is there anything to be done?

Thanks!

Mark Sandan

unread,
Mar 9, 2021, 7:43:03 PM3/9/21
to grpc.io
Are you using any keepalive settings on the client and/or server? If so, check these settings since they may be closing connections. If you are using a LoadBalancer, there may be a timeout that is enabled that closes the connection. For example, the AWS Application Load Balancer has an IdleTimeout that can close the connection once the duration is reached. From a cpp client this looks like an errcode=13, errmsg=Received RST_STREAM with error code 2.
Reply all
Reply to author
Forward
0 new messages