Closed mdaley closed 8 years ago
you should know that the eredis_client start by gen_server:start_link/4
.
the first error causes the erlang shell process die and the erlang shell process is link with the eredis_client process(you start it in erlang shell),so it cause the eredis_client process die too.Thus when you ping
again, the second error come.
you can read the gen_server:start_link/3
document and the erlang link Mechanism
And ,the eredis do has reconnect Mechanism
my english is poor,i hope you can know what i mean.
Thanks for the reply. We think we have a way of dealing with the problem.
Hello,
From my reading of the eredis documentation, it seems to me that if the connection to redis fails, eredis itself should not fail and, when the connection recovers, requests should work again. Is that correct or have I misread what is possible (highly likely as I am very new to erlang)?
So, my example is that if I compile eredis and point it at a redis server, I can successfully do commands, like this:
And, when I physically disconnect my network cable, I get an error (which I would expect):
When I reconnect my network cable (and wait for the connection to start working again), I was hoping that requests would start working again but, instead, I only get errors:
The difference between the second error and the first is that the second mentions
noproc
instead oftimeout
. I assume that the eredis process has died.Is it possible to make it such that the process doesn't die and it starts working again once the connection is working again?
Of course, I am, probably, misunderstanding how processes should work in the erlang world!