[erlang-questions] Fwd: poolboy new_worker failed cause poolboy crashed

linbo liao llbgurs@REDACTED
Thu Apr 16 03:19:44 CEST 2015


Hi José,

I add a proxy process to handle the issue (
https://github.com/yunba/eredis_pool/blob/master/src/eredis_proxy.erl), but
wired if connect redis timeout, proxy process sometimes will be shutdown
although I set trap_exit = true.

I test it , find all connections timeout when multi client call connnect
simulataneous, after eredis_client exit info received, eredis_proxy will be
shutdown. I have totally no idea about it.

Did I miss something?

Thanks,
Linbo

2015-04-14 19:01 GMT+08:00 linbo liao <llbgurs@REDACTED>:

> Thanks, looks a nice way to solve the issue, I will create a proxy worker
> to have a try.
>
> 2015-04-14 16:49 GMT+08:00 José Valim <jose.valim@REDACTED>:
>
>> 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
>> Elixir:
>>
>>
>> https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/pubsub/redis_conn.ex
>>
>> 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
>> start_link too.
>>
>>
>>
>> *José Valim*
>> www.plataformatec.com.br
>> Skype: jv.ptec
>> Founder and Lead Developer
>>
>> On Tue, Apr 14, 2015 at 10:26 AM, linbo liao <llbgurs@REDACTED> wrote:
>>
>>> Hi,
>>>
>>> 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?
>>>
>>> Thanks,
>>> Linbo
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150416/a3489c48/attachment.htm>


More information about the erlang-questions mailing list