简体   繁体   English

grpc:服务器重启后大约15秒无法恢复连接

[英]grpc: Cannot restore connection for approximately 15 seconds after server restart

The client cannot restore a connection to the server immediately after server restart. 服务器重启后,客户端无法立即恢复与服务器的连接。 Instead, it restores connection only after 15 seconds idling. 相反,它仅在空闲15秒后恢复连接。 I also cannot call server with a newly created channel/client from the same process. 我也无法使用同一进程中新创建的通道/客户端调用服务器。 But it successfully connected if I launch a new client instance in the separate process. 但是如果我在单独的进程中启动一个新的客户端实例,它就会成功连接。

I am not sure but suppose the issue appeared after moving from 1.0.0 to 1.6.1 grpc version. 我不确定但是假设在从1.0.0移动到1.6.1 grpc版本后问题出现了。 Maybe any new setting was introduced to change this behavior? 也许引入了任何新的设置来改变这种行为?

My call state: 我的电话状态:

0. Grpc.Core.Internal.CompletionQueueSafeHandle.Pluck (Source Unavailable)
1. Grpc.Core.Internal.AsyncCall`2.UnaryCall (Source Unavailable)
2. Grpc.Core.DefaultCallInvoker.BlockingUnaryCall (Source Unavailable)
3. Grpc.Core.Internal.InterceptingCallInvoker.BlockingUnaryCall (Source Unavailable)

Maybe any new setting was introduced to change this behavior? 也许引入了任何新的设置来改变这种行为?

I looked in grpc release notes from 1.0.0 to 1.6.1 and found following relevevant change in 1.6 note (C# section): 我查看了从1.0.0到1.6.1的grpc发行说明,并发现1.6注释 (C#部分)中的相关变化:

User handlers don't run on Grpc's thread pool anymore for extra safety. 用户处理程序不再在Grpc的线程池上运行以提高安全性。

You may have to make some code adjustment into handler. 您可能需要对处理程序进行一些代码调整。 Hope this would help. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM