aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-11-09 14:05:51 +0100
committerMicael Karlberg <[email protected]>2011-11-09 14:05:51 +0100
commitb27432ee4f0d0809ea668cd9e4fcb4f601652cbd (patch)
tree6b38ffc73fcd2af81c9ee988a485f91073f410e9 /lib/snmp/src
parentf561a98a9b89738467b52ab5213562de753f6ad2 (diff)
downloadotp-b27432ee4f0d0809ea668cd9e4fcb4f601652cbd.tar.gz
otp-b27432ee4f0d0809ea668cd9e4fcb4f601652cbd.tar.bz2
otp-b27432ee4f0d0809ea668cd9e4fcb4f601652cbd.zip
Bad note store GC timer deactivation.
Wrong field in the state record was set (timeout instead active). Stefan Grundmann OTP-9690
Diffstat (limited to 'lib/snmp/src')
-rw-r--r--lib/snmp/src/app/snmp.appup.src18
-rw-r--r--lib/snmp/src/misc/snmp_note_store.erl15
2 files changed, 29 insertions, 4 deletions
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src
index 0b6ea93231..b4b5367169 100644
--- a/lib/snmp/src/app/snmp.appup.src
+++ b/lib/snmp/src/app/snmp.appup.src
@@ -22,8 +22,14 @@
%% ----- U p g r a d e -------------------------------------------------------
[
+ {"4.21.1",
+ [
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []}
+ ]
+ },
{"4.21",
[
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
{load_module, snmp_target_mib, soft_purge, soft_purge, []}
]
},
@@ -40,6 +46,7 @@
{load_module, snmpa_mpd, soft_purge, soft_purge,
[snmp_conf, snmp_config]},
{load_module, snmpa_conf, soft_purge, soft_purge, [snmp_config]},
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]},
{update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
{update, snmpm_server, soft, soft_purge, soft_purge,
@@ -61,6 +68,7 @@
{load_module, snmpa_mpd, soft_purge, soft_purge,
[snmp_conf, snmp_config]},
{load_module, snmpa_conf, soft_purge, soft_purge, [snmp_config]},
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]},
{update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
{update, snmpm_server, soft, soft_purge, soft_purge,
@@ -99,6 +107,7 @@
{load_module, snmp_community_mib, soft_purge, soft_purge, []},
{load_module, snmp_target_mib, soft_purge, soft_purge,
[snmp_conf]},
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
{update, snmpm_net_if, soft, soft_purge, soft_purge,
[snmp_conf, snmpm_mpd, snmpm_config]},
{update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
@@ -115,8 +124,14 @@
%% ------D o w n g r a d e ---------------------------------------------------
[
+ {"4.21.1",
+ [
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []}
+ ]
+ },
{"4.21",
[
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
{load_module, snmp_target_mib, soft_purge, soft_purge, []}
]
},
@@ -133,6 +148,7 @@
{load_module, snmpa_mpd, soft_purge, soft_purge,
[snmp_conf, snmp_config]},
{load_module, snmpa_conf, soft_purge, soft_purge, [snmp_config]},
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]},
{update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
{update, snmpm_server, soft, soft_purge, soft_purge,
@@ -154,6 +170,7 @@
{load_module, snmpa_mpd, soft_purge, soft_purge,
[snmp_conf, snmp_config]},
{load_module, snmpa_conf, soft_purge, soft_purge, [snmp_config]},
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]},
{update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
{update, snmpm_server, soft, soft_purge, soft_purge,
@@ -192,6 +209,7 @@
{load_module, snmp_community_mib, soft_purge, soft_purge, []},
{load_module, snmp_target_mib, soft_purge, soft_purge,
[snmp_conf]},
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
{update, snmpm_net_if, soft, soft_purge, soft_purge,
[snmp_conf, snmpm_mpd, snmpm_config]},
{update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
diff --git a/lib/snmp/src/misc/snmp_note_store.erl b/lib/snmp/src/misc/snmp_note_store.erl
index a21a6209f1..23fccf8a5f 100644
--- a/lib/snmp/src/misc/snmp_note_store.erl
+++ b/lib/snmp/src/misc/snmp_note_store.erl
@@ -258,10 +258,17 @@ code_change({down, _Vsn}, State, _Extra) ->
{ok, NState};
% upgrade
-code_change(_Vsn, State, _Extra) ->
+code_change(_Vsn, State0, _Extra) ->
process_flag(trap_exit, true),
- NState = restart_timer(State),
- {ok, NState}.
+ State1 =
+ case State0 of
+ #state{timeout = false} ->
+ State0#state{timeout = ?timeout};
+ _ ->
+ State0
+ end,
+ State2 = restart_timer(State1),
+ {ok, State2}.
%%----------------------------------------------------------
@@ -282,7 +289,7 @@ deactivate_timer(#state{timer = Pid, active = true} = State) ->
receive
deactivated -> ok
end,
- State#state{timeout = false};
+ State#state{active = false};
deactivate_timer(State) ->
State.