From 052a5e4763839ebdf4031672b6227e7ae8d14dd5 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 18 Feb 2016 23:00:46 +0100 Subject: Remove dead export The export of diameter_traffic:failover/1 happened with the creation of the module in commit e49e7acc, but was never needed since the calling code was also moved into diameter_traffic. --- lib/diameter/src/base/diameter_traffic.erl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/diameter') diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl index 004c1e80d5..32c0e1e516 100644 --- a/lib/diameter/src/base/diameter_traffic.erl +++ b/lib/diameter/src/base/diameter_traffic.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2013-2015. All Rights Reserved. +%% Copyright Ericsson AB 2013-2016. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -40,7 +40,6 @@ -export([make_recvdata/1, peer_up/1, peer_down/1, - failover/1, pending/1]). %% towards ?MODULE @@ -1875,7 +1874,7 @@ failover(TPid) %% notifications are sent here: store_request/2 sends the notification %% in that case. -%% Failover as a consequence of request_peer_down/1: inform the +%% Failover as a consequence of peer_down/1: inform the %% request process. failover({_, Req, TRef}) -> #request{handler = Pid, -- cgit v1.2.3 From 6759d8fd81d52cdfff5a1c2f788f740d1a4e6f67 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Fri, 19 Feb 2016 00:52:15 +0100 Subject: Remove unnecessary parentheses Not needed as of commit 6c9cbd96. --- lib/diameter/src/base/diameter_traffic.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/diameter') diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl index 32c0e1e516..5bfbadb436 100644 --- a/lib/diameter/src/base/diameter_traffic.erl +++ b/lib/diameter/src/base/diameter_traffic.erl @@ -1824,7 +1824,7 @@ store_request(T, TPid) -> ets:member(?REQUEST_TABLE, TPid) orelse begin {_Seqs, _Req, TRef} = T, - (self() ! {failover, TRef}) %% failover/1 may have missed + self() ! {failover, TRef} %% failover/1 may have missed end. %% lookup_request/2 -- cgit v1.2.3 From cc4ccfb0756bb563c869d94b630ccfecb571d6c2 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 18 Feb 2016 23:01:33 +0100 Subject: Fix handling of shared peer connections in watchdog state SUSPECT A peer connection shared from a remote node was regarded as being available for peer selection (aka up) as long as its peer_fsm process was alive; that is, for the lifetime of the peer connection. In particular, it didn't take note of transitions into watchdog state SUSPECT, when the connection remains. As a result, retransmissions could select the same peer connection whose watchdog transition caused the retransmission. A service process now broadcasts a peer_down event just as it does a peer_up event. The fault predates the table rearrangements of commit 8fd4e5f4. --- lib/diameter/src/base/diameter_service.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/diameter') diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index d83ed9e56b..465f74a1fc 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2015. All Rights Reserved. +%% Copyright Ericsson AB 2010-2016. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -487,6 +487,9 @@ transition({service, Pid}, S) -> transition({peer, TPid, Aliases, Caps}, S) -> remote_peer_up(TPid, Aliases, Caps, S), ok; +transition({peer, TPid}, S) -> + remote_peer_down(TPid, S), + ok; %% Remote peer process has died. transition({'DOWN', _, process, TPid, _}, S) -> @@ -1421,8 +1424,9 @@ share_peer(up, Caps, Apps, TPid, #state{options = [_, {_,T} | _], service_name = Svc}) -> notify(T, Svc, {peer, TPid, [A || {_,A} <- Apps], Caps}); -share_peer(_, _, _, _, _) -> - ok. +share_peer(down, _Caps, _Apps, TPid, #state{options = [_, {_,T} | _], + service_name = Svc}) -> + notify(T, Svc, {peer, TPid}). %% --------------------------------------------------------------------------- %% # share_peers/2 -- cgit v1.2.3