mod_stream_mgmt: Improve logging on timeout
Produce a better error message if a pending stream management session times out.
This commit is contained in:
parent
75f150f7ae
commit
af49472373
|
@ -36,6 +36,7 @@
|
||||||
%% adjust pending session timeout
|
%% adjust pending session timeout
|
||||||
-export([get_resume_timeout/1, set_resume_timeout/2]).
|
-export([get_resume_timeout/1, set_resume_timeout/2]).
|
||||||
|
|
||||||
|
-include("ejabberd.hrl").
|
||||||
-include("xmpp.hrl").
|
-include("xmpp.hrl").
|
||||||
-include("logger.hrl").
|
-include("logger.hrl").
|
||||||
-include("p1_queue.hrl").
|
-include("p1_queue.hrl").
|
||||||
|
@ -247,7 +248,10 @@ c2s_handle_info(#{mgmt_state := pending,
|
||||||
{timeout, TRef, pending_timeout}) ->
|
{timeout, TRef, pending_timeout}) ->
|
||||||
?DEBUG("Timed out waiting for resumption of stream for ~s",
|
?DEBUG("Timed out waiting for resumption of stream for ~s",
|
||||||
[jid:encode(JID)]),
|
[jid:encode(JID)]),
|
||||||
Mod:stop(State#{mgmt_state => timeout});
|
Txt = <<"Timed out waiting for stream resumption">>,
|
||||||
|
Err = xmpp:serr_connection_timeout(Txt, ?MYLANG),
|
||||||
|
Mod:stop(State#{mgmt_state => timeout,
|
||||||
|
stop_reason => {stream, {out, Err}}});
|
||||||
c2s_handle_info(#{jid := JID} = State, {_Ref, {resume, OldState}}) ->
|
c2s_handle_info(#{jid := JID} = State, {_Ref, {resume, OldState}}) ->
|
||||||
%% This happens if the resume_session/1 request timed out; the new session
|
%% This happens if the resume_session/1 request timed out; the new session
|
||||||
%% now receives the late response.
|
%% now receives the late response.
|
||||||
|
|
Loading…
Reference in New Issue