Skip to content

Default keep alive behavior only works for the Interactive ConnectionType #1830

@adraut

Description

@adraut

The scenario that was discovered is as follows:
Redis 5.0.2 with the timeout at the default of zero, the tcp-keepalive at the default of 300 and maxclients at the default of 10000.
StackExchange.Redis 2.2.4 with abortConnect=true (the default) and keepAlive=-1 (the default).

Once connected the ServerEndPoint calls AutoConfigureAsync, but only for the Interactive ConnectionType so only the PhysicalBridge for the Interactive ConnectionType will have it's WriteEverySeconds value set to a value greater than zero.

The problem with setup is that if something severs the subscription connection and the Redis server still thinks the client's subscription connection is connected it will never be disconnected/closed on the Redis server and it will eventually hit the maxclients value and stop accepting new connections.

I do not think this is a bug with the client as this is easy to fix by configuring everything properly. At minimum the Redis server should have a timeout value greater than zero. Even better is to set the KeepAlive in the ConfigurationOptions to something greater than zero.

What would be nice is if this behavior of the ConnectionMultiplexer was documented because it is not accurate enough in my opinion. Currently it says:

Time (seconds) at which to send a message to help keep sockets alive (60 sec default)

I think it should state that the default only applies to the Interactive ConnectionType and that the value must be greater than zero for it to run the keep alive process for Subscription ConnectionTypes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions