[erlang-questions] Fwd: [help] The supervisor can not restart the child process , when the child process occur 'function_clause' error!!

Paul Peregud paulperegud@REDACTED
Thu Apr 16 17:36:37 CEST 2015


---------- Forwarded message ----------
From: Paul Peregud <paulperegud@REDACTED>
Date: Thu, Apr 16, 2015 at 5:35 PM
Subject: Re: [erlang-questions] [help] The supervisor can not restart
the child process , when the child process occur 'function_clause'
error!!
To: Fw339tgy <fw339tgy@REDACTED>


Your code is fine. Problem is in the fact that you are starting root
supervisor of your tree from console using start_link. This means that
your shell process is linked to root supervisor. When shell process
crashes, it takes down your supervisor.

You can test this behavior by using following commands:

test:start_link().
whereis(test).
whereis(my_bank).
true = false. %% this will crash your shell.
whereis(test).
whereis(bank).

Additional information is in process_info(self()) in section "links".

On Thu, Apr 16, 2015 at 5:25 PM, Fw339tgy <fw339tgy@REDACTED> wrote:
> test:start_link(). Tha app start.
>
> gen_sever:call(my_bank,{new2,inzaghi}. The command will courr the error.
>
> the right command is gen_sever:call(my_bank,{new,
> inzaghi}.
>
> 发自我的 iPhone
>
>> 在 2015年4月16日,下午11:17,Paul Peregud <paulperegud@REDACTED> 写道:
>>
>> Please provide a sequence of commands that leads to crash.
>>
>> You can check if my_bank gen_server has restarted by running
>> whereis(my_bank) in console.
>>
>>> On Thu, Apr 16, 2015 at 8:02 AM, 谈广云 <fw339tgy@REDACTED> wrote:
>>> The supervisor can not restart the child process , when the child process
>>> occur 'function_clause' error!!
>>>
>>> the test moudle is supervisor 's callback,
>>>
>>> the my_bank is child process 's callback.
>>>
>>> The code in the appendix.
>>>
>>> This problem has troubled me for a long time, very much look forward to your
>>> reply.
>>>
>>> thanks.
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>> --
>> Best regards,
>> Paul Peregud
>> +48602112091
>



--
Best regards,
Paul Peregud
+48602112091


-- 
Best regards,
Paul Peregud
+48602112091



More information about the erlang-questions mailing list