From 5f38e791e17788b4aea4163c8799c3a01bd208af Mon Sep 17 00:00:00 2001 From: Abimael Martinez Date: Mon, 4 Mar 2024 11:27:16 -0700 Subject: [PATCH] add logging --- src/erlmld_wrk_statem.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/erlmld_wrk_statem.erl b/src/erlmld_wrk_statem.erl index d9708a3..701c48c 100644 --- a/src/erlmld_wrk_statem.erl +++ b/src/erlmld_wrk_statem.erl @@ -187,6 +187,7 @@ handle_event({call, From}, {accepted, Socket}, ?INIT, Data) -> %% shutdown action (MLD will read our response, then close its stream to us, then await %% our exit). handle_event(info, {tcp_closed, _}, {?PEER_READ, ?SHUTDOWN}, _) -> + error_logger:info_msg("shutdown message received, shutting down normally~n"), stop; %% connection was closed, but we didn't expect it. handle_event(info, {tcp_closed, _}, _State, _) -> @@ -480,6 +481,7 @@ handle_event(info, Message, _State, #data{worker_state = WorkerState}) -> error_logger:error_msg("~p ignoring unexpected message ~p~n", [WorkerState, Message]), keep_state_and_data; handle_event({timeout, shutdown}, shutdown, _State, _Data) -> + error_logger:error_msg("timeout reached while waiting for SHUTDOWN message, shutdown forced~n"), {stop, {error, shutdown_timeout}}. %%%===================================================================