summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-06-02 13:16:21 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-06-02 13:16:21 +0100
commit00689f9af041a667f9404413bd520df40d84092a (patch)
tree5e32260f9e497e54ada7385de460d7478fa3c5e5
parentd5ecd1810c1eec0b70cd9d2915b3e0c87efc2e75 (diff)
parent04104dfab65029426bff43ead277946a51b47705 (diff)
downloadrabbitmq-server-git-00689f9af041a667f9404413bd520df40d84092a.tar.gz
Merge in stable
-rw-r--r--src/gm.erl15
-rw-r--r--src/rabbit_networking.erl4
2 files changed, 10 insertions, 9 deletions
diff --git a/src/gm.erl b/src/gm.erl
index e8d56e8ca5..fd8da7da27 100644
--- a/src/gm.erl
+++ b/src/gm.erl
@@ -746,7 +746,7 @@ prioritise_info({'DOWN', _MRef, process, LeftPid, _Reason}, _Len,
%% But prioritise all other DOWNs - we want to make sure we are not
%% sending activity into the void for too long because our right is
%% down but we don't know it.
-prioritise_info({'DOWN', MRef, process, Pid, _Reason}, _Len, _State) ->
+prioritise_info({'DOWN', _MRef, process, _Pid, _Reason}, _Len, _State) ->
1;
prioritise_info(_, _Len, _State) ->
0.
@@ -1062,8 +1062,7 @@ join_group(Self, GroupName, #gm_group { members = Members } = Group, TxnFun) ->
TxnFun)
end,
try
- case ?INSTR_MOD:call(
- get_pid(Left), {add_on_right, Self}, infinity) of
+ case neighbour_call(Left, {add_on_right, Self}) of
{ok, Group1} -> group_to_view(Group1);
not_ready -> join_group(Self, GroupName, TxnFun)
end
@@ -1178,6 +1177,8 @@ can_erase_view_member(Self, Self, _LA, _LP) -> false;
can_erase_view_member(_Self, _Id, N, N) -> true;
can_erase_view_member(_Self, _Id, _LA, _LP) -> false.
+neighbour_cast(N, Msg) -> ?INSTR_MOD:cast(get_pid(N), Msg).
+neighbour_call(N, Msg) -> ?INSTR_MOD:call(get_pid(N), Msg, infinity).
%% ---------------------------------------------------------------------------
%% View monitoring and maintanence
@@ -1186,17 +1187,17 @@ can_erase_view_member(_Self, _Id, _LA, _LP) -> false.
ensure_neighbour(_Ver, Self, {Self, undefined}, Self) ->
{Self, undefined};
ensure_neighbour(Ver, Self, {Self, undefined}, RealNeighbour) ->
- ok = ?INSTR_MOD:cast(get_pid(RealNeighbour), {?TAG, Ver, check_neighbours}),
+ ok = neighbour_cast(RealNeighbour, {?TAG, Ver, check_neighbours}),
{RealNeighbour, maybe_monitor(RealNeighbour, Self)};
ensure_neighbour(_Ver, _Self, {RealNeighbour, MRef}, RealNeighbour) ->
{RealNeighbour, MRef};
ensure_neighbour(Ver, Self, {RealNeighbour, MRef}, Neighbour) ->
true = erlang:demonitor(MRef),
Msg = {?TAG, Ver, check_neighbours},
- ok = ?INSTR_MOD:cast(get_pid(RealNeighbour), Msg),
+ ok = neighbour_cast(RealNeighbour, Msg),
ok = case Neighbour of
Self -> ok;
- _ -> ?INSTR_MOD:cast(get_pid(Neighbour), Msg)
+ _ -> neighbour_cast(Neighbour, Msg)
end,
{Neighbour, maybe_monitor(Neighbour, Self)}.
@@ -1341,7 +1342,7 @@ maybe_send_activity(Activity, #state { self = Self,
send_right(Right, View, {activity, Self, Activity}).
send_right(Right, View, Msg) ->
- ok = ?INSTR_MOD:cast(get_pid(Right), {?TAG, view_version(View), Msg}).
+ ok = neighbour_cast(Right, {?TAG, view_version(View), Msg}).
callback(Args, Module, Activity) ->
Result =
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl
index 1da977262f..9082dbd353 100644
--- a/src/rabbit_networking.erl
+++ b/src/rabbit_networking.erl
@@ -135,8 +135,8 @@ boot_ssl() ->
{ok, []} ->
ok;
{ok, SslListeners} ->
- [start_ssl_listener(Listener, ensure_ssl())
- || Listener <- SslListeners],
+ SslOpts = ensure_ssl(),
+ [start_ssl_listener(Listener, SslOpts) || Listener <- SslListeners],
ok
end.