As I look at how the Connection is managed, it seems the connection instance starts life with broken = false, but nowhere in the code does broken get set back to false, say on disconnect().
Why this matters: When trying to connect to a server that currently not reachable, the following code should work:
private val redis: Jedis,
...
if (!redis.
isConnected || redis.
isBroken) {
try {
redis.disconnect()
}
catch (eX: Exception) {
}
redis.connect()
}
...
which will always be true if the connection was ever broken because there is no code anywhere to set broken = false. I think this is a one line fix to simply set broken = false during disconnect() or right before
socket = socketFactory.createSocket();
during connect().
Should I bug it up? and then PR? Am I missing the right way to reset a connection?
Any help much appreciated. Thanks!