]> granicus.if.org Git - ejabberd/commitdiff
Ignore late arrival of an already cancelled timer
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Mon, 8 Jul 2019 16:32:37 +0000 (19:32 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Mon, 8 Jul 2019 16:32:37 +0000 (19:32 +0300)
src/mod_stream_mgmt.erl

index 1ebff130cd49a90a8f497dcf6c827daa88fa294c..030a36b8014ed5c9c508039ea12be2eda552a456 100644 (file)
@@ -257,6 +257,12 @@ c2s_handle_info(#{jid := JID} = State, {_Ref, {resume, OldState}}) ->
           [jid:encode(JID)]),
     route_unacked_stanzas(OldState#{mgmt_resend => false}),
     {stop, State};
+c2s_handle_info(State, {timeout, _, Timeout}) when Timeout == ack_timeout;
+                                                  Timeout == pending_timeout ->
+    %% Late arrival of an already cancelled timer: we just ignore it.
+    %% This might happen because misc:cancel_timer/1 doesn't guarantee
+    %% timer cancelation in the case when p1_server is used.
+    {stop, State};
 c2s_handle_info(State, _) ->
     State.