From 32eee8a3ee2df5fa52f5120b65e236496c1c6c79 Mon Sep 17 00:00:00 2001 From: Xavier Vello Date: Wed, 31 May 2017 15:10:53 +0200 Subject: [PATCH] skip packet re-sending on error, drop instead --- datadog/dogstatsd/base.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/datadog/dogstatsd/base.py b/datadog/dogstatsd/base.py index 8c72e089b..3658a4d20 100644 --- a/datadog/dogstatsd/base.py +++ b/datadog/dogstatsd/base.py @@ -286,17 +286,9 @@ def _send_to_server(self, packet): # dogstatsd is overflowing, drop the packets (mimicks the UDP behaviour) return except socket.error: - log.info("Error submitting packet, will try refreshing the socket") - + log.info("Error submitting packet, dropping the packet and closing the socket") self.close_socket() - try: - self.get_socket().send(packet.encode(self.encoding)) - except socket.error: - self.close_socket() - - log.exception("Failed to send packet with a newly bound socket") - def _send_to_buffer(self, packet): self.buffer.append(packet) if len(self.buffer) >= self.max_buffer_size: