diff options
author | Emile Joubert <emile@rabbitmq.com> | 2012-05-24 16:55:18 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2012-05-24 16:55:18 +0100 |
commit | a1f4d79fb5061392652248f5d7bbdc6bcc68a62e (patch) | |
tree | ee3f6fedf5ee4f812e8958dd63c24326b19817e5 /src/rabbit_alarm.erl | |
parent | 908a71409123940507474449b4547c98069ff2c9 (diff) | |
download | rabbitmq-server-a1f4d79fb5061392652248f5d7bbdc6bcc68a62e.tar.gz |
Allow nodes to start up in alerted statebug24961
Diffstat (limited to 'src/rabbit_alarm.erl')
-rw-r--r-- | src/rabbit_alarm.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_alarm.erl b/src/rabbit_alarm.erl index 04e0c141..d16d90a4 100644 --- a/src/rabbit_alarm.erl +++ b/src/rabbit_alarm.erl @@ -162,17 +162,17 @@ maybe_alert(UpdateFun, Node, Source, end, State#alarms{alarmed_nodes = AN1}. -alert_local(Alert, Alertees, _Source) -> - alert(Alertees, [Alert], fun erlang:'=:='/2). +alert_local(Alert, Alertees, Source) -> + alert(Alertees, Source, Alert, fun erlang:'=:='/2). alert_remote(Alert, Alertees, Source) -> - alert(Alertees, [Source, Alert], fun erlang:'=/='/2). + alert(Alertees, Source, Alert, fun erlang:'=/='/2). -alert(Alertees, AlertArg, NodeComparator) -> +alert(Alertees, Source, Alert, NodeComparator) -> Node = node(), dict:fold(fun (Pid, {M, F, A}, ok) -> case NodeComparator(Node, node(Pid)) of - true -> apply(M, F, A ++ [Pid] ++ AlertArg); + true -> apply(M, F, A ++ [Pid, Source, Alert]); false -> ok end end, ok, Alertees). @@ -181,7 +181,7 @@ internal_register(Pid, {M, F, A} = HighMemMFA, State = #alarms{alertees = Alertees}) -> _MRef = erlang:monitor(process, Pid), case dict:find(node(), State#alarms.alarmed_nodes) of - {ok, _Sources} -> apply(M, F, A ++ [Pid, true]); + {ok, Sources} -> [apply(M, F, A ++ [Pid, R, true]) || R <- Sources]; error -> ok end, NewAlertees = dict:store(Pid, HighMemMFA, Alertees), |