[erlang-questions] supervisor woes
Jared Nance
jared.nance@REDACTED
Thu Sep 9 00:17:33 CEST 2010
solved.
Basically I hadn't realized that if in the child spec, the argument to child:start_link was a list of length N, child:start_link/N would be called. This resulted in {'EXIT', undef, {....}} coming back at me once I had sasl running, and helped me track it down to this.
Thanks for all the help.
JN
On Sep 8, 2010, at 1:43 PM, Anthony Molinaro wrote:
>
> What does the child spec for the supervisor calling your supervisor look like?
> Maybe you are calling your supervisor a worker in that spec?
>
> -Anthony
>
> On Wed, Sep 08, 2010 at 01:21:27PM -0700, Jared Nance wrote:
>> Also, as a point of clarification: If I start the ios_card_super manually with the multiple children, it works without a hitch - all of the ios_faux_cards get registered correctly and behave normally. It's only when I try to start the ios_card_super as a supervised node in a supervision tree that I have the problem.
>>
>> On Sep 8, 2010, at 11:59 AM, Adam Kocoloski wrote:
>>
>>> On Sep 8, 2010, at 11:36 AM, Jared Nance wrote:
>>>
>>>> Hello List-
>>>> Thanks in advance for whatever help you can offer. I'm putting together a supervision tree which is rather simple - at the moment, there is a supervisor that manages several other supervisors, and those supervisors each manage only worker nodes. The problem I am having is with one of my supervisors which manages 4 worker nodes. Each node is a gen_server that uses the same callback module, but with different arguments to start_link. The childspec for the worker nodes looks like
>>>>
>>>> {cardA, {ios_faux_card, start_link, [cardA]}, permanent, brutal_kill, worker, [ios_faux_card]}
>>>>
>>>> and so the supervisor for these workers is started with a child spec that looks like
>>>>
>>>> {{one_for_one, 5, 10}, [{ios_card_super, {ios_card_super, start_link, [{cardA, {ios_faux_card, start_link, [cardA]}, permanent, brutal_kill, worker, [ios_faux_card]}], permanent, infinity, supervisor, [ios_card_super]}
>>>>
>>>> and that works just fine. the problem arises when i try to add a second (or third, or fourth) gen_server to the list of processes that the ios_card_super is supervising. if i try starting it with this child spec instead:
>>>>
>>>> {{one_for_one, 5, 10}, [{ios_card_super, {ios_card_super, start_link, [{cardA, {ios_faux_card, start_link, [cardA]}, permanent, brutal_kill, worker, [ios_faux_card]},{cardB,{ios_faux_card, start_link, [cardB]}, permanent, brutal_kill, worker, [ios_faux_card]}], permanent, infinity, supervisor, [ios_card_super]}
>>>>
>>>> it refuses to start. what's more, the only response I get out of it is {error, shutdown}. I have put io:format debug statements in the ios_faux_card module and it's clear that start_link/1is never being called when there are 2+ workers to supervise.
>>>>
>>>> Thanks for whatever help you can offer on this very frustrating issue.
>>>>
>>>> Jared N
>>>
>>> Hi Jared, you wouldn't happen to be trying to register the process in ios_faux_card, would you?
>>>
>>> Adam
>>>
>>>
>>>
>>> ________________________________________________________________
>>> erlang-questions (at) erlang.org mailing list.
>>> See http://www.erlang.org/faq.html
>>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>>>
>>
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>>
>
> --
> ------------------------------------------------------------------------
> Anthony Molinaro <anthonym@REDACTED>
More information about the erlang-questions
mailing list