derekjw/fyrie-redis

Closed connections not handled

Closed this issue · 4 comments

When the redis server closes the connection for being idle, it doesn't seem like this is detected or handled anywhere. Obviously, I'd prefer a silent and automatic reconnect!

This happens on the Akka-1.1 branch if that matters.

I have some ideas on how to implement that. I'll try to get to that today.

I have updated the akka-1.1 branch with a fix that may work. My test is failing sometimes while under load, but I am using the QUIT command to generate the disconnects. The failure I'm seeing is some of the commands are being executed twice.

It may be that Redis is accepting some of the commands but doesn't send a reply before the disconnection, so it is impossible to know if Redis actually received the commands or not. If that is the case then this fix is as best as can be done. If not, and it's a problem with my code, hopefully I'll find it :)

I think I figured it out. If more commands were sent to the server after the QUIT command, I would sometimes have the connection close to the before I had the chance to read what the server sent back before the QUIT command.

At least I know that this isn't an issue that will come up with a timed out connection since in that case there would be no sent commands waiting for responses.

I'm going to close this one for now. Let me know if you still see an issue.