[erlang-questions] poolboy new_worker failed cause poolboy crashed
Tue Apr 14 10:49:12 CEST 2015
You don't need to modify eredis per se. You can create a worker that is
between poolboy and eredis that tracks the connected/disconnected semantics
as Devin described. Unfortunately I don't know of any sample Erlang code
but, if you don't mind, here is a similar solution using redo written in
To use it, you checkout the worker above from the pool, ask the redis
connection to the worker and do the operations you want to in the
connection as usual.
As a note, I did find it a bit weird that eredis handles disconnects
automatically but it does not handle the case where it can't connect to
Redis on start_link. It would be handful if they supported lazy connections
(i.e. don't connect on start_link but on first command). They already have
all the code to handle this, it is just a matter of supporting it on
Founder and Lead Developer
On Tue, Apr 14, 2015 at 10:26 AM, linbo liao <> wrote:
> I open an issue for poolboy (https://github.com/devinus/poolboy/issues/72),
> but looks author doesn't think this is an issue.
> Looks like to solve this issue have two ways:
> 1. Modify eredis client, start_link still return ok when connect failed,
> and when use it should check eredis socket alive or not
> 2. Modify poolboy library, protected all logic when call new_worker failed.
> But it require change ereids or poolboy code, I was wondering to know
> anyone hit this issue, how to resolve it?
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions