Skip to content

Upgrade BEAM code cause Mnesia and Ranch crash #39

@chuanjian666

Description

@chuanjian666

We use Mnesia as application's database, when use the cb_admin's upgrade beam code, the mnesia and ranch will be crashed.

11:09:29.166 [error] Supervisor mnesia_kernel_sup had child mnesia_tm started with mnesia_tm:start() at <0.105.0> exit with reason killed in context child_terminated
11:09:29.166 [error] Supervisor mnesia_kernel_sup had child mnesia_tm started with mnesia_tm:start() at <0.105.0> exit with reason reached_max_restart_intensity in context shutdown
11:09:29.167 [error] Supervisor mnesia_sup had child mnesia_kernel_sup started with mnesia_kernel_sup:start() at <0.100.0> exit with reason shutdown in context child_terminated
11:09:29.167 [error] Supervisor mnesia_sup had child mnesia_kernel_sup started with mnesia_kernel_sup:start() at <0.100.0> exit with reason reached_max_restart_intensity in context shutdown
11:09:29.182 [info] Application mnesia exited with reason: shutdown
11:09:29.772 [error] Supervisor {<0.163.0>,ranch_acceptors_sup} had child {acceptor,<0.163.0>,28} started with ranch_acceptor:start_link(#Port<0.22521>, ranch_tcp, <0.162.0>) at <0.191.0> exit with reason killed in context child_terminated
11:09:29.773 [error] Supervisor {<0.163.0>,ranch_acceptors_sup} had child {acceptor,<0.163.0>,29} started with ranch_acceptor:start_link(#Port<0.22521>, ranch_tcp, <0.162.0>) at <0.192.0> exit with reason killed in context child_terminated
11:09:29.773 [error] Supervisor {<0.163.0>,ranch_acceptors_sup} had child {acceptor,<0.163.0>,5} started with ranch_acceptor:start_link(#Port<0.22521>, ranch_tcp, <0.162.0>) at <0.168.0> exit with reason killed in context child_terminated
11:09:29.773 [error] Supervisor {<0.163.0>,ranch_acceptors_sup} had child {acceptor,<0.163.0>,1} started with ranch_acceptor:start_link(#Port<0.22521>, ranch_tcp, <0.162.0>) at <0.164.0> exit with reason killed in context child_terminated
11:09:29.773 [error] Supervisor {<0.163.0>,ranch_acceptors_sup} had child {acceptor,<0.163.0>,2} started with ranch_acceptor:start_link(#Port<0.22521>, ranch_tcp, <0.162.0>) at <0.165.0> exit with reason killed in context child_terminated
11:09:29.773 [error] Supervisor {<0.163.0>,ranch_acceptors_sup} had child {acceptor,<0.163.0>,6} started with ranch_acceptor:start_link(#Port<0.22521>, ranch_tcp, <0.162.0>) at <0.169.0> exit with reason killed in context child_terminated

By reading the mnesia source code, I found this comment in mnesia_sp.erl module

%% To able to generate nice crash reports we need a catch on the highest level.
%% This code can't be purged so a code change is not possible.
%% And hence this a simple module.

So I solved this problem temporarily by filtering mnesia and ranch related modules from code:all_loaded()

Some people also commit this issue in mail list
https://groups.google.com/forum/#!topic/chicagoboss/sKN7Bvpeskc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions