[erlang-questions] ** exception exit: shutdown : SOLVED dets_server:stop().
Chandru
chandrashekhar.mullaparthi@REDACTED
Tue Aug 18 12:27:56 CEST 2015
On 15 August 2015 at 05:21, Sid Muller <sid5@REDACTED> wrote:
> It appears that when I close all dets files there is a lingering dets
> process left because if I run:
> dets_server:stop().
>
> Then the shell doesn't report "** exception exit: shutdown"
>
> Is that normal? Should I be calling dets_server:stop() from my code once I
> close dets files? None of the dets example use cases show that.
>
I doubt it is caused by dets_server. dets_server seems to be a "well
behaved" process. It is a gen_server which traps exits, and the terminate
function gets called when you shutdown the node using q(). My hunch is that
you are not closing all your dets files.
Not sure if you realise, multiple processes can open the same dets file
concurrently and dets maintains a reference count. The reference count has
to go down to zero before the process for the dets file gets shutdown
gracefully.
supervisor:which_children(dets_sup).
should tell you if there are any pending dets processes.
cheers,
Chandru
> *Sent:* Friday, August 14, 2015 at 8:52 AM
> *From:* "Sid Muller" <sid5@REDACTED>
> *To:* Chandru <chandrashekhar.mullaparthi@REDACTED>
> *Cc:* erlang-questions <erlang-questions@REDACTED>
> *Subject:* Re: [erlang-questions] ** exception exit: shutdown
> I'm using erlang 18.0, on ubuntu 14. It was also happening with 17.5, I'm
> running my own application which has been working fine for months. This
> issue showed up after I added code to open dets files, I do close all the
> dets files before I quit my application.
>
> I ran the commands you suggested below but interestingly there is no more
> info with it, matches your lines up untill the point it's supose to print
> what went wrong but then nothing...., so frustrating:
>
> 3> whereis(init).
> <0.0.0>
> 4> dbg:tracer().
> {ok,<0.5341.0>}
> 5> dbg:p(whereis(init), [s,r]).
> {ok,[{matched,nonode@REDACTED,1}]}
> 6> q().
> (<0.0.0>) << {stop,stop}
> (<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}
> ok
> ** exception exit: shutdown
> 7> (no error logger present) error: <0.5341.0>
> sidm@REDACTED:~/src/proj$
>
>
> *Sent:* Thursday, August 13, 2015 at 2:55 PM
> *From:* Chandru <chandrashekhar.mullaparthi@REDACTED>
> *To:* "Sid Muller" <sid5@REDACTED>
> *Cc:* erlang-questions <erlang-questions@REDACTED>
> *Subject:* Re: [erlang-questions] ** exception exit: shutdown
> Which version of erlang are you using? What OS? Trying it on OS X, the
> node dies quietly. Not entirely sure why you are seeing the "exception
> exit" message. Did you have any processes running before you invoked q()?
> Basically the node shutdown procedure is being invoked, and all your
> processes get killed.
>
> Functions you type in the shell are defined in shell_default.erl.
>
> shell_default:q/0 is defined as:
>
>
>
> q() -> c:q().
>
> c:q/0 is defined as:
>
>
> -spec q() -> no_return().
>
>
>
> q() ->
>
> init:stop().
>
> If you turn tracing on for the init process to see what happens.
>
>
> $ ~/erlang/R17-5/bin/erl
>
> Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10]
> [hipe] [kernel-poll:false]
>
>
>
> Eshell V6.4 (abort with ^G)
>
> 1> whereis(init).
>
> <0.0.0>
>
> 2>
>
> 2>
>
> 2>
>
> 2> dbg:tracer().
>
> {ok,<0.35.0>}
>
> 3> dbg:p(whereis(init), [s,r]).
>
> {ok,[{matched,nonode@REDACTED,1}]}
>
> 4>
>
> 4>
>
> 4> q().
>
> (<0.0.0>) << {stop,stop}
>
> (<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}
>
> ok
>
> 5> (no error logger present) error: "Error in process <0.35.0> with exit
> value: {badarg,[{io,format,[user,\"** dbg got EXIT - terminating:
> ~p~n\",[{trace_handler_crashed,{badarg,[{io,format,[user,\"(~p) <<
> ~p~n\",[<0.0.0>,{'EXIT',<0.7.0>,shutdown}]],[]},{dbg,dhandler1,3,[{file,\"dbg.erl\"},{line,983}]},{dbg,invoke_handler...
> \n"
>
>
>
> Chandru
>
>
>
> On 13 August 2015 at 16:26, Sid Muller <sid5@REDACTED> wrote:
>>
>> Hi,
>>
>> does anyone have any pointers on how to debug an exception exit in shell?
>>
>> When I type q(). into the shell I get this:
>>
>> 3> q().
>> ok
>> ** exception exit: shutdown
>> 4> sidm@REDACTED:~/src/proj$
>>
>>
>> The problem is I don't know where to look since the exception is so
>> terse. Does anyone have any pointers?
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>
> _______________________________________________ erlang-questions mailing
> list erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150818/cd627884/attachment.htm>
More information about the erlang-questions
mailing list