aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_service.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2014-05-25 09:28:09 +0200
committerAnders Svensson <[email protected]>2014-05-25 09:28:09 +0200
commita9ee1f31d669143303f38b3f8d4568fad568d841 (patch)
tree8bcaa9827b086e3d58d15b55218956fdd519bad8 /lib/diameter/src/base/diameter_service.erl
parent8231acf6362e8902ca60ecabbafc18f42ec4534a (diff)
parenta8f56846ab342d85a6d6e72f9ba129c8a7f0c1bf (diff)
downloadotp-a9ee1f31d669143303f38b3f8d4568fad568d841.tar.gz
otp-a9ee1f31d669143303f38b3f8d4568fad568d841.tar.bz2
otp-a9ee1f31d669143303f38b3f8d4568fad568d841.zip
Merge branch 'anders/diameter/request_leak/OTP-11893' into maint
* anders/diameter/request_leak/OTP-11893: Fix leaking request table Add check that request table is empty to failover suite Comment fix
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r--lib/diameter/src/base/diameter_service.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index 8914992f17..0faf52c1ec 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -499,9 +499,21 @@ transition(Req, S) ->
%% # terminate/2
%% ---------------------------------------------------------------------------
-terminate(Reason, #state{service_name = Name} = S) ->
+terminate(Reason, #state{service_name = Name, peerT = PeerT} = S) ->
send_event(Name, stop),
ets:delete(?STATE_TABLE, Name),
+
+ %% Communicate pending loss of any peers that connection_down/3
+ %% won't. This is needed when stopping a service since we don't
+ %% wait for watchdog state changes to take care of if. That this
+ %% takes place after deleting the state entry ensures that the
+ %% resulting failover by request processes accomplishes nothing.
+ ets:foldl(fun(#peer{pid = TPid}, _) ->
+ diameter_traffic:peer_down(TPid)
+ end,
+ ok,
+ PeerT),
+
shutdown == Reason %% application shutdown
andalso shutdown(application, S).