diff options
author | Anders Svensson <[email protected]> | 2014-05-25 09:28:44 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2014-05-25 09:28:44 +0200 |
commit | d9ca987b0440662816589895bb5adf6f27322a25 (patch) | |
tree | 941ce8a088359dd8f279322ac20bf5564a46ceb4 /lib/diameter/src/base/diameter_service.erl | |
parent | a9ee1f31d669143303f38b3f8d4568fad568d841 (diff) | |
parent | 53aa56b26eeb97c99bd125b53121f5a3f4767949 (diff) | |
download | otp-d9ca987b0440662816589895bb5adf6f27322a25.tar.gz otp-d9ca987b0440662816589895bb5adf6f27322a25.tar.bz2 otp-d9ca987b0440662816589895bb5adf6f27322a25.zip |
Merge branch 'anders/diameter/watchdog_leak/OTP-11934' into maint
* anders/diameter/watchdog_leak/OTP-11934:
Simplify sending of 'close' to watchdog
Fix watchdog table leak
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 0faf52c1ec..0dc3eb7123 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -881,7 +881,7 @@ watchdog(TPid, [], ?WD_OKAY, ?WD_SUSPECT = To, Wd, State) -> %% Watchdog has lost its connection. watchdog(TPid, [], _, ?WD_DOWN = To, Wd, #state{peerT = PeerT} = S) -> - close(Wd, S), + close(Wd), watchdog_down(Wd, To, S), ets:delete(PeerT, TPid); @@ -1199,26 +1199,16 @@ 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}, _) -> +close(#watchdog{type = connect}) -> ok; + close(#watchdog{type = accept, pid = Pid, - ref = Ref, - options = Opts}, - #state{service_name = SvcName}) -> - c(Pid, diameter_config:have_transport(SvcName, Ref), Opts). - -%% Tell watchdog to (maybe) die later ... -c(Pid, true, Opts) -> + options = Opts}) -> Tc = connect_timer(Opts, 2*?DEFAULT_TC), - erlang:send_after(Tc, Pid, close); - -%% ... or now. -c(Pid, false, _Opts) -> - Pid ! close. - + erlang:send_after(Tc, Pid, close). %% The RFC's only document the behaviour of Tc, our connect_timer, %% for the establishment of connections but we also give %% connect_timer semantics for a listener, being the time within |