Folsom supervisor dies everytime ErlangVM gets any exception/error
ztmr opened this issue · comments
I think this should not happen:
tmr@gersemi:~/src/tmp/folsom$ erl -pa deps/bear/ebin -pa ebin -sname foo
Erlang R15B (erts-5.9) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9 (abort with ^G)
(foo@gersemi)1>
(foo@gersemi)1>
(foo@gersemi)1>
(foo@gersemi)1> folsom_sup:start_link ().
{ok,<0.42.0>}
(foo@gersemi)2>
(foo@gersemi)2> a=b.
** exception error: no match of right hand side value b
(foo@gersemi)3>
=ERROR REPORT==== 24-Apr-2012::22:26:46 ===
** Generic server folsom_sup terminating
** Last message in was {'EXIT',<0.40.0>,{{badmatch,b},[{erl_eval,expr,3,[]}]}}
** When Server state == {state,
{local,folsom_sup},
one_for_one,
[{child,<0.44.0>,folsom_metrics_histogram_ets,
{folsom_metrics_histogram_ets,start_link,[]},
permanent,2000,worker,
[folsom_metrics_histogram_ets]},
{child,<0.43.0>,folsom_meter_timer_server,
{folsom_meter_timer_server,start_link,[]},
permanent,2000,worker,
[folsom_meter_timer_server]}],
undefined,1000,3600,[],folsom_sup,[]}
** Reason for termination ==
** {{badmatch,b},[{erl_eval,expr,3,[]}]}
(foo@gersemi)3>
Am I doing something wrong?
Tom
Well, calling folsom_sup:start_link() will link folsom to your shell process, so it will die when your shell does. It's probably wrong for folsom:start/0 to call start_link when it actually shouldn't be linked.
I'm going to submit a pull request soon that lets you start folsom in a more sensible way using application:start(folsom), where it won't die when your shell does.
See #18 - this would basically fix your issue, although you would want to start calling folsom:start() instead of folsom_sup:start_link().
Per Bob's PR this is fixed.