diff options
author | Anders Svensson <[email protected]> | 2014-05-22 22:38:53 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2014-05-23 16:12:04 +0200 |
commit | b1138f27083b1d36a6a20e1d2538b3fbaff61702 (patch) | |
tree | 74e33f886f9b3da01959d104f3f77067e5368fbc /lib/diameter/src/base/diameter_watchdog.erl | |
parent | 53aa56b26eeb97c99bd125b53121f5a3f4767949 (diff) | |
download | otp-b1138f27083b1d36a6a20e1d2538b3fbaff61702.tar.gz otp-b1138f27083b1d36a6a20e1d2538b3fbaff61702.tar.bz2 otp-b1138f27083b1d36a6a20e1d2538b3fbaff61702.zip |
Ensure watchdog dies with transport if DPA was sent
A DPR/DPA exchange should always cause the watchdog process in question
to die with the transport, so that a subsequent connection with the same
peer doesn't result in a 3 x DWR/DWA exchange. Commit 5903d6db saw to
this for the sending of DPR but neglected the corresponding problem for
DPA.
In the case of sending DPR (the aforementioned commit), note that
there's no distinction between receiving DPA as expected and not: the
watchdog dies with the transport regardless.
diameter_watchdog must be loaded first at upgrade.
Diffstat (limited to 'lib/diameter/src/base/diameter_watchdog.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_watchdog.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl index 9ec291897e..fb6e9f700d 100644 --- a/lib/diameter/src/base/diameter_watchdog.erl +++ b/lib/diameter/src/base/diameter_watchdog.erl @@ -344,6 +344,11 @@ transition({shutdown = T, Pid, Reason}, #watchdog{parent = Pid, send(TPid, {T, self(), Reason}), S#watchdog{shutdown = true}; +%% Transport is telling us that DPA has been sent in response to DPR: +%% its death should lead to ours. +transition({'DPR', TPid}, #watchdog{transport = TPid} = S) -> + S#watchdog{shutdown = true}; + %% Parent process has died, transition({'DOWN', _, process, Pid, _Reason}, #watchdog{parent = Pid}) -> @@ -415,7 +420,7 @@ transition({open = Key, TPid, _Hosts, T}, %% REOPEN Connection down CloseConnection() %% SetWatchdog() DOWN -%% Transport has died after service requested termination ... +%% Transport has died after DPA or service requested termination ... transition({'DOWN', _, process, TPid, _Reason}, #watchdog{transport = TPid, shutdown = true}) -> |