Skip to content

Commit

Permalink
Fix race condition getting date and time in mnesia_recover
Browse files Browse the repository at this point in the history
  • Loading branch information
richcarl committed Dec 3, 2024
1 parent 40159fe commit 3e0a184
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/mnesia/src/mnesia_recover.erl
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,7 @@ handle_call(Msg, _From, State) ->
{noreply, State}.

do_log_mnesia_up(Node) ->
Date = date(),
Time = time(),
{Date, Time} = erlang:localtime(),
Yoyo = {mnesia_up, Node, Date, Time},
case mnesia_monitor:use_dir() of
true ->
Expand All @@ -780,8 +779,7 @@ do_log_mnesia_up(Node) ->
note_up(Node, Date, Time).

do_log_mnesia_down(Node) ->
Date = date(),
Time = time(),
{Date, Time} = erlang:localtime(),
Yoyo = {mnesia_down, Node, Date, Time},
case mnesia_monitor:use_dir() of
true ->
Expand Down

0 comments on commit 3e0a184

Please sign in to comment.