[help] The supervisor can not restart the child process , when the child process occur 'function_clause' error!!

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[help] The supervisor can not restart the child process , when the child process occur 'function_clause' error!!

谈广云
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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

my_bank.erl (3K) Download Attachment
test.erl (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [help] The supervisor can not restart the child process , when the child process occur 'function_clause' error!!

Paul Peregud-2
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, 谈广云 <[hidden email]> 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
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>



--
Best regards,
Paul Peregud
+48602112091
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

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

Paul Peregud-2
---------- Forwarded message ----------
From: Paul Peregud <[hidden email]>
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 <[hidden email]>


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 <[hidden email]> 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 <[hidden email]> 写道:
>>
>> 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, 谈广云 <[hidden email]> 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
>>> [hidden email]
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>> --
>> Best regards,
>> Paul Peregud
>> +48602112091
>



--
Best regards,
Paul Peregud
+48602112091


--
Best regards,
Paul Peregud
+48602112091
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions