Skip to content

Commit

Permalink
Turn EAGAIN warning into debug (#629)
Browse files Browse the repository at this point in the history
It can be super verbose, let's keep it but reduce from warning.
  • Loading branch information
therve authored Feb 5, 2021
1 parent 27e161b commit 498a43f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datadog/dogstatsd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def _xmit_packet(self, packet, is_telemetry):
self.close_socket()
except socket.error as se:
if se.errno == errno.EAGAIN:
log.warning("Socket send would block: {}, dropping the packet".format(se))
log.debug("Socket send would block: %s, dropping the packet", se)
else:
log.warning("Error submitting packet: {}, dropping the packet and closing the socket".format(se))
self.close_socket()
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/dogstatsd/test_statsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ def test_socket_overflown(self):
with mock.patch("datadog.dogstatsd.base.log") as mock_log:
self.statsd.gauge('no error', 1)
mock_log.error.assert_not_called()
c = [call("Socket send would block: Socket error, dropping the packet")]
mock_log.warning.assert_has_calls(c * 2)
c = [call("Socket send would block: %s, dropping the packet", mock.ANY)]
mock_log.debug.assert_has_calls(c * 2)

def test_distributed(self):
"""
Expand Down

0 comments on commit 498a43f

Please sign in to comment.