-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grpc client is always disconnected the connection and then retry to connect to the server after configuring keep-alive parameters #3093
Comments
I tried running the keepalive example found in https://github.com/grpc/grpc-go/tree/master/examples/features/keepalive with the configuration that you are using, and I do not see any connection disconnects. I only see PING messages going back and forth. We do have an issue with the keepalive implementation where it sends a PING every [Time + Timeout] period instead of every [Time] period. But I don't think you are affected by that issue. Could you please make sure there are no other reasons why the connection is terminated. |
grpc.WithKeepaliveParams(keepalive.ClientParameters{
Time: 20,
Timeout: 10,
PermitWithoutStream: true,
}, Assuming this is verbatim from your code, |
Oh yes. I overlooked that. With that verbatim config, I can definitely see the connection being closed. Working as expected, I guess. |
@easwars @dfawley thanks. |
gRPC keepalive is intended to detect network disconnects (TCP) and help prevent proxies from closing connections. reference design HTTP/2 streams do not get closed due to idleness in any system I'm aware of. Glad things are working better with the time units fixed. |
Our grpc stream client is connected to the stream server via LVS. We scheduled the connection to another LVS server, and then the tcp connection was reconnected, but the client always receive a EOF error. Why ? Client and server were connected without keep-alive during the test. |
Streams cannot move between connections - is this what you mean? All streams are terminated any time the network connection is lost. |
Based on our test with lvs in the middle of grpc client and server: |
The |
You mean bidirectional streaming RPC will not find a new connection ? |
In-progress streaming RPCs are not migrated between connections (it's unclear how this would be possible given there is no way to transfer the state of the server to another server). New streaming RPCs will work on the same |
Thank you. |
Before configuring keep-alive parameters, everything is right.
But after configuring keep-alive parameters, the client is always disconnected from the server, and then try to connect it again. It's repeated.
The client configuration is :
The server configuration is :
Why ?
I have track the packets during the communication, and find that after the client sends a ping(flag=0x0) to the server, it immediately shutdowns the connection and then creates a new tcp connection.
Could anyone help me ? Thanks!
The text was updated successfully, but these errors were encountered: