| Author |
Message |
< Erlang questions mailing list ~ what is trap_exit business, process_flag(trap_exit, true) |
| Guest |
Posted: Thu Apr 24, 2008 1:29 am |
|
|
|
Guest
|
In my gen_server:init function, I spawn client processes onto remote
nodes using proc_lib:spawn_link(N, M, F, A). Before I spawn any
process on to remote nodes, I have placed process_flag(trap_exit,
true). But when I do exit kill/shutdown in the shell, my gen_server
and all the remote client processes are terminated mercilessly. I
thought process_flag(trap_exit, true) supposed to prevent the whole
thing from crashing. Are these kill/shutdown type of exits trappable
or only 'EXIT'?
(b@mybox)8> exit(pid(0,147,0)).
** exception exit: <0.147.0>
in function exit/1
called as exit(<0.147.0>)
(b@mybox)9> exit(pid(0,147,0), kill).
true
(b@mybox)10> exit(pid(0,182,0), shutdown).
true
(a@mybox)9>
=ERROR REPORT==== 23-Apr-2008::19:54:52 ===
** Generic server clnt_sup terminating
** Last message in was {'EXIT',<5679.182.0>,shutdown}
** When Server state == {ets_pid,{clnt,loop,[<0.6396.0>]}}
** Reason for termination ==
** {'module could not be loaded',[{ets_pid,tab2list,[]},
{clnt_sup,terminate,2},
{gen_server,terminate,6},
{proc_lib,init_p,5}]}
Thank you,
hoping to get some answers from erlang mailing list, people in IRC are
very helpful.
--
rk
That which we persist in doing becomes easier for us to do; not that
the nature of the thing itself is changed, but that our power to do is
increased.
-Ralph Waldo Emerson
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Thu Apr 24, 2008 12:12 pm |
|
|
|
Guest
|
On Wed, Apr 23, 2008 at 09:21:41PM -0400, db wrote:
> In my gen_server:init function, I spawn client processes onto remote
> nodes using proc_lib:spawn_link(N, M, F, A). Before I spawn any
> process on to remote nodes, I have placed process_flag(trap_exit,
> true). But when I do exit kill/shutdown in the shell, my gen_server
> and all the remote client processes are terminated mercilessly. I
> thought process_flag(trap_exit, true) supposed to prevent the whole
> thing from crashing. Are these kill/shutdown type of exits trappable
> or only 'EXIT'?
>
It is the spawned processes that need to execute
process_flag(trap_exit, true). That property is
not inherited at spawn.
See http://www.erlang.org/doc/reference_manual/part_frame.html,
section 10, esp. 10.4-7.
> (b@mybox)8> exit(pid(0,147,0)).
> ** exception exit: <0.147.0>
> in function exit/1
> called as exit(<0.147.0>)
>
> (b@mybox)9> exit(pid(0,147,0), kill).
> true
>
> (b@mybox)10> exit(pid(0,182,0), shutdown).
> true
>
> (a@mybox)9>
> =ERROR REPORT==== 23-Apr-2008::19:54:52 ===
> ** Generic server clnt_sup terminating
> ** Last message in was {'EXIT',<5679.182.0>,shutdown}
> ** When Server state == {ets_pid,{clnt,loop,[<0.6396.0>]}}
> ** Reason for termination ==
> ** {'module could not be loaded',[{ets_pid,tab2list,[]},
> {clnt_sup,terminate,2},
> {gen_server,terminate,6},
> {proc_lib,init_p,5}]}
> Thank you,
> hoping to get some answers from erlang mailing list, people in IRC are
> very helpful.
> --
> rk
>
> That which we persist in doing becomes easier for us to do; not that
> the nature of the thing itself is changed, but that our power to do is
> increased.
> -Ralph Waldo Emerson
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@erlang.org
> http://www.erlang.org/mailman/listinfo/erlang-questions
--
/ Raimo Niskanen, Erlang/OTP, Ericsson AB
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
Post recived from mailinglist |
|
|
| Back to top |
|
| wuji |
Posted: Fri Aug 17, 2012 8:39 am |
|
|
|
User
Joined: 10 Aug 2012
Posts: 654
|
30 years in prison if convicted on that charge. The The [h2]imitation designer *beep*[/h2] The maximum sentence for aggravated battery is 15 years.After three
of testimony from Brewer, his parents and several other boys boys cheap polo ralph lauren boys who'd witnessed the attack, a six-person jury in the
County Courthouse began deliberations Monday afternoon, but adjourned after three three cheap jordans three hours without a verdict. Tuesday's deliberations were delayed when
said they could not understand what was being said in in cheap replica *beep* in an audio recording of a conversation between Bent and
alleged accomplices taped by police following their arrest.At noon on on imitation designer *beep* on Tuesday, the jury sent a note to Broward County
Michael Robinson asking for a transcript of the recording, but but cheap polo shirts but Robinson replied that no transcript was available.Prosecutors argued that
was trying to avoid responsibility for the violence by offering offering jordan 6 olympic offering others money to hurt Brewer, who was 15 at
time. But defense attorneys claimed that Bent never intended the the cheap Ralph Lauren the attack, calling the case an example of "prosecution overkill."Robinson |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|