I've noticed some issues that are caused by shutting down or restarting my redis server.
If I run a command and it fails due to a broken connection it eventually starts to hang on new commands. On the next immediate command tcp_connect fails due to the unset $fh variable. But anything after does nothing. I think this is because $self->{sock} and $self->{run_cb} are still set after the failed connection, so it doesn't attempt to connect again.
Running $self->cleanup in the connection failure block seems to fix this issue, with the added bonus of getting $self->{on_error} called when a connection fails.
I've noticed some issues that are caused by shutting down or restarting my redis server.
If I run a command and it fails due to a broken connection it eventually starts to hang on new commands. On the next immediate command tcp_connect fails due to the unset $fh variable. But anything after does nothing. I think this is because $self->{sock} and $self->{run_cb} are still set after the failed connection, so it doesn't attempt to connect again.
Running $self->cleanup in the connection failure block seems to fix this issue, with the added bonus of getting $self->{on_error} called when a connection fails.