[erlang-questions] Common test 1.7.X gen_server call noproc in init_per_group

Tien Le letien83@REDACTED
Thu Nov 21 19:03:36 CET 2013


Ohh my bad!
I found that my_server:start() returns an error. That's why the server
can't be started
I should have printed the return from start() function. ;P

Thanks for your help!


On Thu, Nov 21, 2013 at 5:41 PM, Motiejus Jakštys <desired.mta@REDACTED>wrote:

> On Thu, Nov 21, 2013 at 5:23 PM, Tien Le <letien83@REDACTED> wrote:
> > Yes, that's what I thought too. That's why I try to start it again in my
> > init_per_group. My code looks similar like this:
> >
> > init_per_group(_Group, Config) ->
> >       case whereis(?SERVER) of
> >               undefined ->
> >                         my_server:start();
> >               _Pid ->
> >                         ok
> >       end,
> >       my_server:do(...),
> >       Config.
> >
> > I can see some printout that the server is started again, but I still get
> > exit:{noproc, ... execption when I call my_server:do(...)
>
> is my_server:start() a synchronous operation? I.e. are you sure that
> when it returns, the server is up and running?
>
> if you are not sure, try doing a gen_server:call to it right after
> start, and see if it fixes the situation.
>
> >
> > I switch to OTP R15B03 in which it includes Common Test 1.6.X, and it is
> > fine.
>
> If start is asynchronous, the reason might be different scheduler
> behavior (which changed quite a bit in R15->R16).
>
> Motiejus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131121/c555d6b5/attachment.htm>


More information about the erlang-questions mailing list