Skip to content

Commit

Permalink
Add a comment why mnesia:stop() is inside the start function
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Jun 23, 2023
1 parent 1f8bea8 commit 4bff87e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ejabberd_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ stop(_State) ->
?LOG_NOTICE(#{what => mongooseim_node_stopped, version => ?MONGOOSE_VERSION, node => node()}),
delete_pid_file(),
update_status_file(stopped),
%% We cannot stop other applications inside of the stop callback
%% (because we would deadlock the application controller process).
%% That is why we call mnesia:stop() inside of db_init_mnesia() instead.
%%ejabberd_debug:stop(),
ok.

Expand All @@ -124,6 +127,7 @@ db_init() ->
end.

db_init_mnesia() ->
%% Mnesia should not be running at this point, unless it is started by tests.
%% Ensure Mnesia is stopped
mnesia:stop(),
case mnesia:system_info(extra_db_nodes) of
Expand Down

0 comments on commit 4bff87e

Please sign in to comment.