英文:
gRPC failure detection in Golang
问题
我正在尝试使用https://pkg.go.dev/google.golang.org/grpc#ClientConn.WaitForStateChange函数来实现故障检测机制。我注意到当我停止服务器时,gRPC连接的状态从READY变为IDLE。然而,我期望它会转换为TransientFailure状态。我还尝试设置保持活动参数,但似乎行为没有改变。有什么想法是什么原因导致这种行为?
请注意,如果在服务器关闭后进行调用,我将看到TransientFailure状态的变化,否则我只会看到IDLE状态。
英文:
I am trying to use https://pkg.go.dev/google.golang.org/grpc#ClientConn.WaitForStateChange function to implement a failure detection mechanism. I noticed when I stop the server the state of the gRPC connection goes from READY to IDLE. However, I expect it goes to TransientFailure state. I also tried to set keep alive parameters but it doesn't seem there is a change in that behavior. Any ideas what could causing this behavior?
Consider that If I make a call after the server down, I will see TransientFailure state change otherwise what I see is just IDLE state.
答案1
得分: 0
IDLE是正确的下一个状态。如果发送了任何新的RPC请求,客户端将尝试连接,此时它将进入CONNECTING状态,然后是TRANSIENT_FAILURE状态。
英文:
IDLE is the correct next state, here. If any new RPCs are sent, the client will attempt to connect, at which point it will go to CONNECTING and then TRANSIENT_FAILURE.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论