Readjust log level into error when got unexpected message
This commit is contained in:
parent
58e1b4d485
commit
0fbf771543
|
@ -103,7 +103,7 @@ handle_event({set_alarm, Alarm = {AlarmId, AlarmDesc}}, State) ->
|
||||||
set_alarm_(AlarmId, AlarmDesc),
|
set_alarm_(AlarmId, AlarmDesc),
|
||||||
{ok, State};
|
{ok, State};
|
||||||
handle_event({clear_alarm, AlarmId}, State) ->
|
handle_event({clear_alarm, AlarmId}, State) ->
|
||||||
?LOG(notice, "~p clear", [AlarmId]),
|
?LOG(notice, "[Alarm Handler] ~p clear", [AlarmId]),
|
||||||
emqx_broker:safe_publish(alarm_msg(topic(clear, maybe_to_binary(AlarmId)), <<"">>)),
|
emqx_broker:safe_publish(alarm_msg(topic(clear, maybe_to_binary(AlarmId)), <<"">>)),
|
||||||
clear_alarm_(AlarmId),
|
clear_alarm_(AlarmId),
|
||||||
{ok, State};
|
{ok, State};
|
||||||
|
|
|
@ -88,11 +88,11 @@ init([]) ->
|
||||||
{ok, ensure_expiry_timer(#{expiry_timer => undefined})}.
|
{ok, ensure_expiry_timer(#{expiry_timer => undefined})}.
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Banned] unexpected call: ~p", [Req]),
|
?LOG(error, "[Banned] unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Banned] unexpected msg: ~p", [Msg]),
|
?LOG(error, "[Banned] unexpected msg: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({timeout, TRef, expire}, State = #{expiry_timer := TRef}) ->
|
handle_info({timeout, TRef, expire}, State = #{expiry_timer := TRef}) ->
|
||||||
|
@ -100,7 +100,7 @@ handle_info({timeout, TRef, expire}, State = #{expiry_timer := TRef}) ->
|
||||||
{noreply, ensure_expiry_timer(State), hibernate};
|
{noreply, ensure_expiry_timer(State), hibernate};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Banned] unexpected info: ~p", [Info]),
|
?LOG(error, "[Banned] unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, #{expiry_timer := TRef}) ->
|
terminate(_Reason, #{expiry_timer := TRef}) ->
|
||||||
|
|
|
@ -209,7 +209,7 @@ safe_publish(Msg) when is_record(Msg, message) ->
|
||||||
publish(Msg)
|
publish(Msg)
|
||||||
catch
|
catch
|
||||||
_:Error:Stacktrace ->
|
_:Error:Stacktrace ->
|
||||||
?LOG(error, "[Broker] publish error: ~p~n~p~n~p", [Error, Msg, Stacktrace])
|
?LOG(error, "[Broker] Publish error: ~p~n~p~n~p", [Error, Msg, Stacktrace])
|
||||||
after
|
after
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
@ -424,7 +424,7 @@ handle_call({subscribe, Topic, I}, _From, State) ->
|
||||||
{reply, Ok, State};
|
{reply, Ok, State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Broker] unexpected call: ~p", [Req]),
|
?LOG(error, "[Broker] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast({subscribe, Topic}, State) ->
|
handle_cast({subscribe, Topic}, State) ->
|
||||||
|
@ -454,11 +454,11 @@ handle_cast({unsubscribed, Topic, I}, State) ->
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Broker] unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Broker] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Broker] unexpected info: ~p", [Info]),
|
?LOG(error, "[Broker] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, #{pool := Pool, id := Id}) ->
|
terminate(_Reason, #{pool := Pool, id := Id}) ->
|
||||||
|
|
|
@ -110,7 +110,7 @@ init([]) ->
|
||||||
{ok, #{pmon => emqx_pmon:new()}}.
|
{ok, #{pmon => emqx_pmon:new()}}.
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Broker Helper] unexpected call: ~p", [Req]),
|
?LOG(error, "[Broker Helper] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast({register_sub, SubPid, SubId}, State = #{pmon := PMon}) ->
|
handle_cast({register_sub, SubPid, SubId}, State = #{pmon := PMon}) ->
|
||||||
|
@ -119,7 +119,7 @@ handle_cast({register_sub, SubPid, SubId}, State = #{pmon := PMon}) ->
|
||||||
{noreply, State#{pmon := emqx_pmon:monitor(SubPid, PMon)}};
|
{noreply, State#{pmon := emqx_pmon:monitor(SubPid, PMon)}};
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Broker Helper] unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Broker Helper] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({'DOWN', _MRef, process, SubPid, _Reason}, State = #{pmon := PMon}) ->
|
handle_info({'DOWN', _MRef, process, SubPid, _Reason}, State = #{pmon := PMon}) ->
|
||||||
|
@ -130,7 +130,7 @@ handle_info({'DOWN', _MRef, process, SubPid, _Reason}, State = #{pmon := PMon})
|
||||||
{noreply, State#{pmon := PMon1}};
|
{noreply, State#{pmon := PMon1}};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Broker Helper] unexpected info: ~p", [Info]),
|
?LOG(error, "[Broker Helper] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -929,7 +929,7 @@ handle_event(info, {inet_reply, _Sock, {error, Reason}}, _, State) ->
|
||||||
{stop, {shutdown, Reason}, State};
|
{stop, {shutdown, Reason}, State};
|
||||||
|
|
||||||
handle_event(EventType, EventContent, StateName, _StateData) ->
|
handle_event(EventType, EventContent, StateName, _StateData) ->
|
||||||
?LOG(notice, "[Client] State: ~s, Unexpected Event: (~p, ~p)",
|
?LOG(error, "[Client] State: ~s, Unexpected Event: (~p, ~p)",
|
||||||
[StateName, EventType, EventContent]),
|
[StateName, EventType, EventContent]),
|
||||||
keep_state_and_data.
|
keep_state_and_data.
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ init([]) ->
|
||||||
{ok, #{conn_pmon => emqx_pmon:new()}}.
|
{ok, #{conn_pmon => emqx_pmon:new()}}.
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[CM] unexpected call: ~p", [Req]),
|
?LOG(error, "[CM] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast({notify, {registered, ClientId, ConnPid}}, State = #{conn_pmon := PMon}) ->
|
handle_cast({notify, {registered, ClientId, ConnPid}}, State = #{conn_pmon := PMon}) ->
|
||||||
|
@ -169,7 +169,7 @@ handle_cast({notify, {unregistered, ConnPid}}, State = #{conn_pmon := PMon}) ->
|
||||||
{noreply, State#{conn_pmon := emqx_pmon:demonitor(ConnPid, PMon)}};
|
{noreply, State#{conn_pmon := emqx_pmon:demonitor(ConnPid, PMon)}};
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[CM] unexpected cast: ~p", [Msg]),
|
?LOG(error, "[CM] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({'DOWN', _MRef, process, Pid, _Reason}, State = #{conn_pmon := PMon}) ->
|
handle_info({'DOWN', _MRef, process, Pid, _Reason}, State = #{conn_pmon := PMon}) ->
|
||||||
|
@ -180,7 +180,7 @@ handle_info({'DOWN', _MRef, process, Pid, _Reason}, State = #{conn_pmon := PMon}
|
||||||
{noreply, State#{conn_pmon := PMon1}};
|
{noreply, State#{conn_pmon := PMon1}};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[CM] unexpected info: ~p", [Info]),
|
?LOG(error, "[CM] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -286,12 +286,12 @@ handle({call, From}, session, State = #state{proto_state = ProtoState}) ->
|
||||||
reply(From, emqx_protocol:session(ProtoState), State);
|
reply(From, emqx_protocol:session(ProtoState), State);
|
||||||
|
|
||||||
handle({call, From}, Req, State) ->
|
handle({call, From}, Req, State) ->
|
||||||
?LOG(notice, "[Connection] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Connection] Unexpected call: ~p", [Req]),
|
||||||
reply(From, ignored, State);
|
reply(From, ignored, State);
|
||||||
|
|
||||||
%% Handle cast
|
%% Handle cast
|
||||||
handle(cast, Msg, State) ->
|
handle(cast, Msg, State) ->
|
||||||
?LOG(notice, "[Connection] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Connection] Unexpected cast: ~p", [Msg]),
|
||||||
{keep_state, State};
|
{keep_state, State};
|
||||||
|
|
||||||
%% Handle Incoming
|
%% Handle Incoming
|
||||||
|
@ -361,7 +361,7 @@ handle(info, {shutdown, Reason}, State) ->
|
||||||
shutdown(Reason, State);
|
shutdown(Reason, State);
|
||||||
|
|
||||||
handle(info, Info, State) ->
|
handle(info, Info, State) ->
|
||||||
?LOG(notice, "[Connection] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Connection] Unexpected info: ~p", [Info]),
|
||||||
{keep_state, State}.
|
{keep_state, State}.
|
||||||
|
|
||||||
code_change(_Vsn, State, Data, _Extra) ->
|
code_change(_Vsn, State, Data, _Extra) ->
|
||||||
|
|
|
@ -107,7 +107,7 @@ init([]) ->
|
||||||
{ok, #state{seq = 0}}.
|
{ok, #state{seq = 0}}.
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Ctl] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Ctl] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast({register_command, Cmd, MF, Opts}, State = #state{seq = Seq}) ->
|
handle_cast({register_command, Cmd, MF, Opts}, State = #state{seq = Seq}) ->
|
||||||
|
@ -124,11 +124,11 @@ handle_cast({unregister_command, Cmd}, State) ->
|
||||||
noreply(State);
|
noreply(State);
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Ctl] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Ctl] Unexpected cast: ~p", [Msg]),
|
||||||
noreply(State).
|
noreply(State).
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Ctl] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Ctl] Unexpected info: ~p", [Info]),
|
||||||
noreply(State).
|
noreply(State).
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -181,7 +181,7 @@ handle_call({add, HookPoint, Callback = #callback{action = Action}}, _From, Stat
|
||||||
{reply, Reply, State};
|
{reply, Reply, State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Hooks] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Hooks] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast({del, HookPoint, Action}, State) ->
|
handle_cast({del, HookPoint, Action}, State) ->
|
||||||
|
@ -194,11 +194,11 @@ handle_cast({del, HookPoint, Action}, State) ->
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Hooks] Unexpected msg: ~p", [Msg]),
|
?LOG(error, "[Hooks] Unexpected msg: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Hooks] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Hooks] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -97,7 +97,7 @@ handle_call({submit, Task}, _From, State) ->
|
||||||
{reply, catch run(Task), State};
|
{reply, catch run(Task), State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Pool] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Pool] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast({async_submit, Task}, State) ->
|
handle_cast({async_submit, Task}, State) ->
|
||||||
|
@ -108,11 +108,11 @@ handle_cast({async_submit, Task}, State) ->
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Pool] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Pool] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Pool] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Pool] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, #{pool := Pool, id := Id}) ->
|
terminate(_Reason, #{pool := Pool, id := Id}) ->
|
||||||
|
|
|
@ -198,15 +198,15 @@ handle_call({delete_route, Topic, Dest}, _From, State) ->
|
||||||
{reply, Ok, State};
|
{reply, Ok, State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Router] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Router] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Router] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Router] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Router] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Router] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, #{pool := Pool, id := Id}) ->
|
terminate(_Reason, #{pool := Pool, id := Id}) ->
|
||||||
|
|
|
@ -103,11 +103,11 @@ init([]) ->
|
||||||
{ok, #{nodes => Nodes}, hibernate}.
|
{ok, #{nodes => Nodes}, hibernate}.
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Router Helper] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Router Helper] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Router Helper] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Router Helper] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({mnesia_table_event, {write, {?ROUTING_NODE, Node, _}, _}}, State = #{nodes := Nodes}) ->
|
handle_info({mnesia_table_event, {write, {?ROUTING_NODE, Node, _}, _}}, State = #{nodes := Nodes}) ->
|
||||||
|
@ -141,7 +141,7 @@ handle_info({membership, _Event}, State) ->
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Route Helper] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Route Helper] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -478,7 +478,7 @@ handle_call(close, _From, State) ->
|
||||||
{stop, normal, ok, State};
|
{stop, normal, ok, State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Session] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Session] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
%% SUBSCRIBE:
|
%% SUBSCRIBE:
|
||||||
|
@ -587,7 +587,7 @@ handle_cast({update_expiry_interval, Interval}, State) ->
|
||||||
{noreply, State#state{expiry_interval = Interval}};
|
{noreply, State#state{expiry_interval = Interval}};
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Session] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Session] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({dispatch, Topic, Msg}, State) when is_record(Msg, message) ->
|
handle_info({dispatch, Topic, Msg}, State) when is_record(Msg, message) ->
|
||||||
|
@ -668,7 +668,7 @@ handle_info({'EXIT', Pid, Reason}, State = #state{conn_pid = ConnPid}) ->
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Session] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Session] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(Reason, #state{will_msg = WillMsg,
|
terminate(Reason, #state{will_msg = WillMsg,
|
||||||
|
|
|
@ -101,11 +101,11 @@ handle_call(count_sessions, _From, State = #state{sessions = SessMap}) ->
|
||||||
{reply, maps:size(SessMap), State};
|
{reply, maps:size(SessMap), State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Session Supervisor] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Session Supervisor] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Session Supervisor] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Session Supervisor] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({'EXIT', Pid, _Reason}, State = #state{sessions = SessMap, clean_down = CleanDown}) ->
|
handle_info({'EXIT', Pid, _Reason}, State = #state{sessions = SessMap, clean_down = CleanDown}) ->
|
||||||
|
|
|
@ -310,11 +310,11 @@ handle_call({unsubscribe, Group, Topic, SubPid}, _From, State) ->
|
||||||
{reply, ok, State};
|
{reply, ok, State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Shared Sub] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Shared Sub] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Shared Sub] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Shared Sub] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({mnesia_table_event, {write, NewRecord, _}}, State = #state{pmon = PMon}) ->
|
handle_info({mnesia_table_event, {write, NewRecord, _}}, State = #state{pmon = PMon}) ->
|
||||||
|
@ -334,7 +334,7 @@ handle_info({'DOWN', _MRef, process, SubPid, _Reason}, State = #state{pmon = PMo
|
||||||
{noreply, update_stats(State#state{pmon = emqx_pmon:erase(SubPid, PMon)})};
|
{noreply, update_stats(State#state{pmon = emqx_pmon:erase(SubPid, PMon)})};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Shared Sub] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Shared Sub] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -250,15 +250,15 @@ init([]) ->
|
||||||
{ok, #{}}.
|
{ok, #{}}.
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[SM] Unexpected call: ~p", [Req]),
|
?LOG(error, "[SM] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[SM] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[SM] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[SM] Unexpected info: ~p", [Info]),
|
?LOG(error, "[SM] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -96,11 +96,11 @@ init([]) ->
|
||||||
{ok, #{}}.
|
{ok, #{}}.
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Registry] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Registry] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Registry] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Registry] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({membership, {mnesia, down, Node}}, State) ->
|
handle_info({membership, {mnesia, down, Node}}, State) ->
|
||||||
|
@ -114,7 +114,7 @@ handle_info({membership, _Event}, State) ->
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Registry] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Registry] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -181,7 +181,7 @@ start_timer(#state{tick_ms = Ms} = State) ->
|
||||||
handle_call(stop, _From, State) ->
|
handle_call(stop, _From, State) ->
|
||||||
{stop, normal, _Reply = ok, State};
|
{stop, normal, _Reply = ok, State};
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Stats] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Stats] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast({setstat, Stat, MaxStat, Val}, State) ->
|
handle_cast({setstat, Stat, MaxStat, Val}, State) ->
|
||||||
|
@ -209,7 +209,7 @@ handle_cast({cancel_update, Name}, State = #state{updates = Updates}) ->
|
||||||
{noreply, State#state{updates = lists:keydelete(Name, #update.name, Updates)}};
|
{noreply, State#state{updates = lists:keydelete(Name, #update.name, Updates)}};
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Stats] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Stats] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({timeout, TRef, tick}, State = #state{timer = TRef, updates = Updates}) ->
|
handle_info({timeout, TRef, tick}, State = #state{timer = TRef, updates = Updates}) ->
|
||||||
|
@ -228,7 +228,7 @@ handle_info({timeout, TRef, tick}, State = #state{timer = TRef, updates = Update
|
||||||
{noreply, start_timer(State#state{updates = Updates1}), hibernate};
|
{noreply, start_timer(State#state{updates = Updates1}), hibernate};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG("notice, [Stats] Unexpected info: ~p", [Info]),
|
?LOG("error, [Stats] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, #state{timer = TRef}) ->
|
terminate(_Reason, #state{timer = TRef}) ->
|
||||||
|
|
|
@ -117,11 +117,11 @@ handle_call(uptime, _From, State) ->
|
||||||
{reply, uptime(State), State};
|
{reply, uptime(State), State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[SYS] Unexpected call: ~p", [Req]),
|
?LOG(error, "[SYS] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[SYS] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[SYS] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({timeout, TRef, heartbeat}, State = #state{heartbeat = TRef}) ->
|
handle_info({timeout, TRef, heartbeat}, State = #state{heartbeat = TRef}) ->
|
||||||
|
@ -138,7 +138,7 @@ handle_info({timeout, TRef, tick}, State = #state{ticker = TRef, version = Versi
|
||||||
{noreply, tick(State), hibernate};
|
{noreply, tick(State), hibernate};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[SYS] Unexpected info: ~p", [Info]),
|
?LOG(error, "[SYS] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, #state{heartbeat = TRef1, ticker = TRef2}) ->
|
terminate(_Reason, #state{heartbeat = TRef1, ticker = TRef2}) ->
|
||||||
|
|
|
@ -88,11 +88,11 @@ parse_opt([_Opt|Opts], Acc) ->
|
||||||
parse_opt(Opts, Acc).
|
parse_opt(Opts, Acc).
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[SYSMON] Unexpected call: ~p", [Req]),
|
?LOG(error, "[SYSMON] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[SYSMON] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[SYSMON] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({monitor, Pid, long_gc, Info}, State) ->
|
handle_info({monitor, Pid, long_gc, Info}, State) ->
|
||||||
|
@ -147,7 +147,7 @@ handle_info({timeout, _Ref, reset}, State) ->
|
||||||
{noreply, State#{events := []}, hibernate};
|
{noreply, State#{events := []}, hibernate};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[SYSMON] Unexpected Info: ~p", [Info]),
|
?LOG(error, "[SYSMON] Unexpected Info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, #{timer := TRef}) ->
|
terminate(_Reason, #{timer := TRef}) ->
|
||||||
|
|
|
@ -136,15 +136,15 @@ handle_call(lookup_traces, _From, State = #state{traces = Traces}) ->
|
||||||
{reply, [{Who, LogFile} || {Who, LogFile} <- maps:to_list(Traces)], State};
|
{reply, [{Who, LogFile} || {Who, LogFile} <- maps:to_list(Traces)], State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Tracer] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Tracer] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Tracer] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Tracer] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Tracer] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Tracer] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
|
@ -272,7 +272,7 @@ websocket_info({shutdown, Reason}, State) ->
|
||||||
shutdown(Reason, State);
|
shutdown(Reason, State);
|
||||||
|
|
||||||
websocket_info(Info, State) ->
|
websocket_info(Info, State) ->
|
||||||
?LOG(notice, "[WS Connection] Unexpected info: ~p", [Info]),
|
?LOG(error, "[WS Connection] Unexpected info: ~p", [Info]),
|
||||||
{ok, State}.
|
{ok, State}.
|
||||||
|
|
||||||
terminate(SockError, _Req, #state{keepalive = Keepalive,
|
terminate(SockError, _Req, #state{keepalive = Keepalive,
|
||||||
|
|
|
@ -92,7 +92,7 @@ handle_call(force_reload, _From, State) ->
|
||||||
{reply, ok, State};
|
{reply, ok, State};
|
||||||
|
|
||||||
handle_call(Req, _From, State) ->
|
handle_call(Req, _From, State) ->
|
||||||
?LOG(notice, "[Zone] Unexpected call: ~p", [Req]),
|
?LOG(error, "[Zone] Unexpected call: ~p", [Req]),
|
||||||
{reply, ignored, State}.
|
{reply, ignored, State}.
|
||||||
|
|
||||||
handle_cast({set_env, Zone, Key, Val}, State) ->
|
handle_cast({set_env, Zone, Key, Val}, State) ->
|
||||||
|
@ -100,7 +100,7 @@ handle_cast({set_env, Zone, Key, Val}, State) ->
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
handle_cast(Msg, State) ->
|
handle_cast(Msg, State) ->
|
||||||
?LOG(notice, "[Zone] Unexpected cast: ~p", [Msg]),
|
?LOG(error, "[Zone] Unexpected cast: ~p", [Msg]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(reload, State) ->
|
handle_info(reload, State) ->
|
||||||
|
@ -108,7 +108,7 @@ handle_info(reload, State) ->
|
||||||
{noreply, ensure_reload_timer(State#{timer := undefined}), hibernate};
|
{noreply, ensure_reload_timer(State#{timer := undefined}), hibernate};
|
||||||
|
|
||||||
handle_info(Info, State) ->
|
handle_info(Info, State) ->
|
||||||
?LOG(notice, "[Zone] Unexpected info: ~p", [Info]),
|
?LOG(error, "[Zone] Unexpected info: ~p", [Info]),
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
terminate(_Reason, _State) ->
|
terminate(_Reason, _State) ->
|
||||||
|
|
Loading…
Reference in New Issue