From 3a3e91b3592c911fc251c496421135a1a116fa00 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Mon, 7 Sep 2015 16:57:30 +0200 Subject: Fix watchdog function_clause Commit 4f365c07 introduced the error on set_watchdog/2, as a consequence of timeout/1 returning stop, which only happens with accepting transports with {restrict_connections, false}. --- lib/diameter/src/base/diameter_watchdog.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/diameter/src') diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl index 885dc6c801..26bca7a5bc 100644 --- a/lib/diameter/src/base/diameter_watchdog.erl +++ b/lib/diameter/src/base/diameter_watchdog.erl @@ -539,13 +539,13 @@ set_watchdog(#watchdog{tref = undefined} = S) -> %% Timer already set: start at new one only at expiry. set_watchdog(#watchdog{} = S) -> - S#watchdog{tref = now()}; - -set_watchdog(stop = No) -> - No. + S#watchdog{tref = now()}. %% set_watchdog/2 +set_watchdog(_, stop = No) -> + No; + set_watchdog(Ms, #watchdog{tw = TwInit} = S) -> S#watchdog{tref = erlang:start_timer(tw(TwInit, Ms), self(), tw)}. -- cgit v1.2.3 From 516708326db6887190425f5c020e66dfe3666a67 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Sun, 20 Dec 2015 16:23:20 +0100 Subject: Be resilient to diameter_service state upgrades By not failing in code that looks up state: pick_peer and service_info. --- lib/diameter/src/base/diameter_service.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/diameter/src') diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index a31cef2c8c..ed22ef7801 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -206,7 +206,7 @@ stop_transport(SvcName, [_|_] = Refs) -> info(SvcName, Item) -> case lookup_state(SvcName) of - [#state{} = S] -> + [S] -> service_info(Item, S); [] -> undefined @@ -215,7 +215,12 @@ info(SvcName, Item) -> %% lookup_state/1 lookup_state(SvcName) -> - ets:lookup(?STATE_TABLE, SvcName). + case ets:lookup(?STATE_TABLE, SvcName) of + [#state{}] = L -> + L; + _ -> + [] + end. %% --------------------------------------------------------------------------- %% # subscribe/1 -- cgit v1.2.3 From 464492d2ebe24bc13c91fbc99550c05eead599d4 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Sun, 20 Dec 2015 10:23:44 +0100 Subject: Update/fix appup for 17.5.6.7 OTP-12947 strict_mbit OTP-12969 watchdog function_clause OTP-13137 request leak diameter_config (that allows the new option) should be loaded after the others. Anchor was missing from one regexp. Patches did not accumulate through older versions. --- lib/diameter/src/diameter.appup.src | 66 ++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 38 deletions(-) (limited to 'lib/diameter/src') diff --git a/lib/diameter/src/diameter.appup.src b/lib/diameter/src/diameter.appup.src index adb3f960ff..7d66557162 100644 --- a/lib/diameter/src/diameter.appup.src +++ b/lib/diameter/src/diameter.appup.src @@ -36,45 +36,40 @@ {"1.4.4", [{restart_application, diameter}]}, {"1.5", [{restart_application, diameter}]}, %% R16B03 {"1.6", [{restart_application, diameter}]}, %% 17.0 - {<<"1\\.(7(\\.1)?|8)$">>, %% 17.[134] + {<<"^1\\.(7(\\.1)?|8)$">>, %% 17.[134] [{restart_application, diameter}]}, {<<"^1.9(\\.1)?$">>, %% 17.5(.3)? - [{load_module, diameter_codec}, - {load_module, diameter_traffic}, - {load_module, diameter_sctp}, - {load_module, diameter_peer_fsm}, + [{restart_application, diameter}]}, + {"1.9.2", [{load_module, diameter_peer_fsm}, %% 17.5.5 {load_module, diameter_watchdog}, {load_module, diameter_stats}, - {load_module, diameter_config}, + {load_module, diameter_codec}, {load_module, diameter_lib}, {load_module, diameter_peer}, {load_module, diameter_reg}, {load_module, diameter_service}, {load_module, diameter_session}, {load_module, diameter_sync}, + {load_module, diameter_traffic}, + {load_module, diameter_sctp}, {load_module, diameter_gen_base_rfc6733}, {load_module, diameter_gen_acct_rfc6733}, {load_module, diameter_gen_base_rfc3588}, {load_module, diameter_gen_base_accounting}, - {load_module, diameter_gen_relay}]}, - {"1.9.2", [{load_module, diameter_peer_fsm}, %% 17.5.5 - {load_module, diameter_watchdog}, - {load_module, diameter_stats}, - {load_module, diameter_config}, + {load_module, diameter_gen_relay}, + {load_module, diameter}, + {load_module, diameter_config}]}, + {"1.9.2.1", [{load_module, diameter_watchdog}, %% 17.5.6.3 {load_module, diameter_codec}, - {load_module, diameter_lib}, - {load_module, diameter_peer}, - {load_module, diameter_reg}, - {load_module, diameter_service}, - {load_module, diameter_session}, - {load_module, diameter_sync}, {load_module, diameter_traffic}, - {load_module, diameter_sctp}, + {load_module, diameter_service}, {load_module, diameter_gen_base_rfc6733}, {load_module, diameter_gen_acct_rfc6733}, {load_module, diameter_gen_base_rfc3588}, {load_module, diameter_gen_base_accounting}, - {load_module, diameter_gen_relay}]} + {load_module, diameter_gen_relay}, + {load_module, diameter, + {load_module, diameter_config}}]} ], [ {"0.9", [{restart_application, diameter}]}, @@ -93,44 +88,39 @@ {"1.4.4", [{restart_application, diameter}]}, {"1.5", [{restart_application, diameter}]}, {"1.6", [{restart_application, diameter}]}, - {<<"1\\.(7(\\.1)?|8)$">>, + {<<"^1\\.(7(\\.1)?|8)$">>, [{restart_application, diameter}]}, {<<"^1.9(\\.1)?$">>, - [{load_module, diameter_gen_relay}, + [{restart_application, diameter}]}, + {"1.9.2", [{load_module, diameter_config}, + {load_module, diameter}, + {load_module, diameter_gen_relay}, {load_module, diameter_gen_base_accounting}, {load_module, diameter_gen_base_rfc3588}, {load_module, diameter_gen_acct_rfc6733}, {load_module, diameter_gen_base_rfc6733}, + {load_module, diameter_sctp}, + {load_module, diameter_traffic}, {load_module, diameter_sync}, {load_module, diameter_session}, {load_module, diameter_service}, {load_module, diameter_reg}, {load_module, diameter_peer}, {load_module, diameter_lib}, - {load_module, diameter_config}, + {load_module, diameter_codec}, {load_module, diameter_stats}, {load_module, diameter_watchdog}, - {load_module, diameter_peer_fsm}, - {load_module, diameter_sctp}, - {load_module, diameter_traffic}, - {load_module, diameter_codec}]}, - {"1.9.2", [{load_module, diameter_gen_relay}, + {load_module, diameter_peer_fsm}]}, + {"1.9.2.1", [{load_module, diameter_config}, + {load_module, diameter}, + {load_module, diameter_gen_relay}, {load_module, diameter_gen_base_accounting}, {load_module, diameter_gen_base_rfc3588}, {load_module, diameter_gen_acct_rfc6733}, {load_module, diameter_gen_base_rfc6733}, - {load_module, diameter_sctp}, - {load_module, diameter_traffic}, - {load_module, diameter_sync}, - {load_module, diameter_session}, {load_module, diameter_service}, - {load_module, diameter_reg}, - {load_module, diameter_peer}, - {load_module, diameter_lib}, + {load_module, diameter_traffic}, {load_module, diameter_codec}, - {load_module, diameter_config}, - {load_module, diameter_stats}, - {load_module, diameter_watchdog}, - {load_module, diameter_peer_fsm}]} + {load_module, diameter_watchdog}]} ] }. -- cgit v1.2.3