[erlang-questions] my mnesia is lazy

Ulf Wiger <>
Fri May 8 23:36:14 CEST 2009


Attached is one patch (on R13B) that at least cuts down the complaints
to a reasonable minimum - that is, you /may/ get one complaint that
mnesia is overloaded, but you shouldn't get a whole series of them.

One might argue that timer:send_interval/3 is the real culprit, but
changing its behaviour is probably much too late.

BR,
Ulf W

2009/5/8 Ulf Wiger <>:
> Steve Kirsch wrote:
>> well, this is really a common problem that really should be fixed.
>>
>> i ran into the same thing.
>
> Yes, it's a bit annoying, even though you tend to get
> used to Mnesia serenading about being overloaded everytime
> your laptop returns from sleep. (:
>
> Basically, Mnesia should probably notice that it's skipped
> a number of log dumps and do only one dump rather than a
> whole series of them. I haven't looked at the code, but I
> doubt that it would be that hard to fix...
>
> BR,
> Ulf W
>
> --
> Ulf Wiger
> CTO, Erlang Training & Consulting Ltd
> http://www.erlang-consulting.com
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
--- mnesia_controller.erl                       2009-05-06 15:16:25.000000000 -0400
+++ lib/mnesia/src/mnesia_controller.erl	2009-05-08 17:25:11.000000000 -0400
@@ -1085,6 +1085,7 @@
 %%----------------------------------------------------------------------
 
 handle_info({async_dump_log, InitBy}, State) ->
+    flush_dump_messages(),
     Worker = #dump_log{initiated_by = InitBy},
     State2 = add_worker(Worker, State),
     noreply(State2);
@@ -2193,3 +2194,10 @@
     mnesia_lib:intersect(Active, Masters).
     
 
+flush_dump_messages() ->
+    receive
+        {async_dump_log, _} ->
+            flush_dump_messages()
+    after 0 ->
+            ok
+    end.


More information about the erlang-questions mailing list