[erlang-questions] application:stop(mnesia) blocking

Michael Radford mrad-direct-erlang@REDACTED
Wed Jan 28 23:56:12 CET 2009


I'm not 100% sure about this, but I think we figured out that the
application controller is not reentrant, i.e., you can't call
application:stop from within another application:stop.  (Which is
probably where your gen_server's terminate is being called.)

Following OTP principles, you should not start or stop other
applications from within another application, unless you specifically
note the application as "included" and start its top-level supervisor
directly.

Instead, you should manage applications using a boot script, or
something like erlrc [shameless plug]:
http://code.google.com/p/erlrc/

There's typically no need to stop applications while a system is
running, except when the node is shutting down, during a release
upgrade, etc.

Mike

Colm Dougan writes:
> I decided to try and rule out mnesia and so I tried using crypto
> insteand and got exactly the same behavior.  Is there some inherent
> problem with doing application:stop(something) in a gen_server
> terminate?  Where is the correct place to stop applications like
> crypto/mnesia when following OTP principles?
> 
> Thanks,
> Colm
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list