aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_service.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2014-05-19 09:10:00 +0200
committerAnders Svensson <[email protected]>2014-05-20 02:43:03 +0200
commit6d087921e7608691ed5cd554484a13b961d3620f (patch)
treec2000cd0d34479bbd56584bb91098ade1fda5ed2 /lib/diameter/src/base/diameter_service.erl
parent25237481ccccd3ddfa74582dc267632ad618ba30 (diff)
downloadotp-6d087921e7608691ed5cd554484a13b961d3620f.tar.gz
otp-6d087921e7608691ed5cd554484a13b961d3620f.tar.bz2
otp-6d087921e7608691ed5cd554484a13b961d3620f.zip
Fix watchdog table leak
Commit ef5fddcb (diameter-1.4.1, R16B) caused the leak in the case of an accepting watchdog with restrict_connections = false. It (correctly) ensured the state remained at INITIAL but a subsequent 'close' message to terminate the process was ignored since the state was not DOWN. In fact, no 'close' was sent since there was no state transition or previous connection: the former triggers the message from diameter_service, the latter from diameter_watchdog. The message is now sent to self() from the watchdog itself. Send 'close' in the same way when multiple connections to the same peer are allowed, to avoid waiting for a watchdog timer expiry for the process to terminate in this case.
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r--lib/diameter/src/base/diameter_service.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index 70e66537ed..4b2e5b674c 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-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2014. 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
@@ -1188,7 +1188,7 @@ tc(false = No, _, _) -> %% removed
%% another watchdog to be able to detect that it should transition
%% from initial into reopen rather than okay. That someone is either
%% the accepting watchdog upon reception of a CER from the previously
-%% connected peer, or us after connect_timer timeout.
+%% connected peer, or us after connect_timer timeout or immediately.
close(#watchdog{type = connect}, _) ->
ok;
@@ -1199,7 +1199,7 @@ close(#watchdog{type = accept,
#state{service_name = SvcName}) ->
c(Pid, diameter_config:have_transport(SvcName, Ref), Opts).
-%% Tell watchdog to (maybe) die later ...
+%% Tell watchdog to die later ...
c(Pid, true, Opts) ->
Tc = connect_timer(Opts, 2*?DEFAULT_TC),
erlang:send_after(Tc, Pid, close);