-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Labels
Description
Hedis loses connection to a redis cluster, if the redis cluster nodes change their IP addresses during a restart.
How to reproduce the problem
- Start haskell app which talks to redis in cluster mode
- Restart each redis node in a way that IP address of each node changes. This happens when using bitnami redis-cluster helm chart.
- See that the app cannot talk to redis anymore
While the app cannot talk to redis, we get these kinds of error messages:
service: Network.Socket.connect: <socket: 51>: does not exist (No route to host)
Impact
This makes using hedis in Kubernetes very difficult.
Speculation
This could be a result of using socketToHandle here. The docs for the function say:
Caveat Handle is not recommended for network programming in Haskell, e.g. merely performing hClose on a TCP socket won't cooperate with peer's gracefulClose, i.e. proper shutdown sequence with appropriate handshakes specified by the protocol.
It could also be some other problem, this is just speculation.
Additional Info
I create ConnectInfo like this:
Redis.defaultConnectInfo
{ Redis.connectHost = "<kubernetes-service-name>"
Redis.connectPort = 6379,
Redis.connectTimeout = Just (secondsToNominalDiffTime 5),
Redis.connectMaxConnections = 100
}
And connect to redis like this:
Redis.connectCluster connInfo
This connection does not use TLS.