[erlang-questions] order of processes in supervisor

Ladislav Lenart lenartlad@REDACTED
Wed Mar 21 13:09:00 CET 2012


Can you provide us with a stack trace of the crash? Chances
are it is crashing for a different cause than you think.

Ladislav Lenart


On 21.3.2012 12:55, bartek wrote:
> On Wed, 21 Mar 2012 12:32:51 +0100
> bartek<bartek@REDACTED>  wrote:
>
>> Hi
>>
>> Is there a way to configure supervisor so that it makes sure its child
>> processes are started in due order - meaning child B starts only after
>> A started successfully and completed its initialization?
>>
>> I have two processes of which one depends on the other, so I need to
>> make sure that B is running only when A is running. I know can
>> achieve it by monitoring, but I want them both supervised, and when
>> they are being started by a supervisor B goes into a cyclic restart
>> until A gets up, so this is not a clean solution. What is the right
>> way to do it? Start B's supervisor from process A? Or use dynamic
>> child creation somehow? But then a child process would have to get
>> reference to its supervisor and call it after it is done - would it
>> be kosher from OTP point of view?
>>
>> Thanks
>> Bartek Górny
>>
>
>
> I read this one :) But the supervisor seems to trigger their startup
> but not wait for it to complete. At least this is what I observed - my
> child list is [A, B], and B in its init does "monitor(A)", and it
> crashes.
>
> B.
>
>





More information about the erlang-questions mailing list