You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just read the README and it is suggesting that keepalive params can cause connections to shutdown if, for example maximum connection age is reached, but I can't figure out why it's happening here:
No keepalive options are set on the server since my intention is to keep the connections alive until the user decides to disconnect. As per the documentation:
MaxConnectionAgetime.Duration// The current default value is infinity.
What I have observed is that when this is running and the client is connected, the stream seems to disconnect every ~35 seconds. I have a loop reading from the stream like this:
for {
msg:=&proto.Message{}
iferr:=s.stream.RecvMsg(msg); err!=nil {
returnerr
}
}
This returns rpc error: code = Unavailable desc = transport is closing, but I can still send messages on sync RPC functions.
This seems odd to me. The only reason I am sending pings every 10 seconds is to keep the stream alive. Am I missing something here?
The text was updated successfully, but these errors were encountered:
You would need to setup keepalives on the server as well. Without that, the server will receive too many PINGS and will close the connection because it thinks that the client is misbehaving.
See here for a description of how the server enforcement works.
Also see here for an example which shows both the client and server configurations.
You would need to setup keepalives on the server as well. Without that, the server will receive too many PINGS and will close the connection because it thinks that the client is misbehaving.
Clients auto-scale when they receive a signal from the server they are pinging too frequently:
When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug data equal to ASCII "too_many_pings", it should log the occurrence at a log level that is enabled by default and double the configure KEEPALIVE_TIME used for new connections on that channel.
So this behavior should be temporary until the client scales back to a rate acceptable for the server.
This returns rpc error: code = Unavailable desc = transport is closing, but I can still send messages on sync RPC functions.
Clients will always reconnect, so future RPCs will work.
I just read the README and it is suggesting that keepalive params can cause connections to shutdown if, for example maximum connection age is reached, but I can't figure out why it's happening here:
client.go
No keepalive options are set on the server since my intention is to keep the connections alive until the user decides to disconnect. As per the documentation:
So, my server looks like this:
server.go
What I have observed is that when this is running and the client is connected, the stream seems to disconnect every ~35 seconds. I have a loop reading from the stream like this:
This returns
rpc error: code = Unavailable desc = transport is closing
, but I can still send messages on sync RPC functions.This seems odd to me. The only reason I am sending pings every 10 seconds is to keep the stream alive. Am I missing something here?
The text was updated successfully, but these errors were encountered: