Skip to content

Commit

Permalink
Disable the most noisy global distribution logs
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Dec 4, 2024
1 parent 96ed7a4 commit 77042ea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/global_distrib/mod_global_distrib_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ code_change(_OldVsn, State, _Extra) ->
{ok, State}.

terminate(Reason, State) ->
?LOG_ERROR(#{what => gd_outgoing_socket_error,
reason => Reason, peer => State#state.peer, conn_id => State#state.conn_id}),
case Reason of
shutdown ->
?LOG_INFO(#{what => gd_outgoing_socket_error,
reason => Reason, peer => State#state.peer, conn_id => State#state.conn_id});
_ ->
?LOG_ERROR(#{what => gd_outgoing_socket_error,
reason => Reason, peer => State#state.peer, conn_id => State#state.conn_id})

Check warning on line 117 in src/global_distrib/mod_global_distrib_connection.erl

View check run for this annotation

Codecov / codecov/patch

src/global_distrib/mod_global_distrib_connection.erl#L117

Added line #L117 was not covered by tests
end,
mongoose_instrument:execute(?GLOBAL_DISTRIB_OUTGOING_CLOSED, #{}, #{count => 1, host => State#state.host}),
catch mod_global_distrib_transport:close(State#state.socket),
ignore.
Expand Down
13 changes: 10 additions & 3 deletions src/global_distrib/mod_global_distrib_receiver.erl
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,16 @@ code_change(_Version, State, _Extra) ->
{ok, State}.

terminate(Reason, State) ->
?LOG_WARNING(#{what => gd_incoming_socket_closed,
peer => State#state.peer, server => State#state.host,
reason => Reason, conn_id => State#state.conn_id}),
case Reason of
normal ->
?LOG_INFO(#{what => gd_incoming_socket_closed,
peer => State#state.peer, server => State#state.host,
reason => Reason, conn_id => State#state.conn_id});
_ ->
?LOG_WARNING(#{what => gd_incoming_socket_closed,
peer => State#state.peer, server => State#state.host,
reason => Reason, conn_id => State#state.conn_id})

Check warning on line 146 in src/global_distrib/mod_global_distrib_receiver.erl

View check run for this annotation

Codecov / codecov/patch

src/global_distrib/mod_global_distrib_receiver.erl#L146

Added line #L146 was not covered by tests
end,
mongoose_instrument:execute(?GLOBAL_DISTRIB_INCOMING_CLOSED, #{},
#{count => 1, host => State#state.host}),
catch mod_global_distrib_transport:close(State#state.socket),
Expand Down

0 comments on commit 77042ea

Please sign in to comment.