Skip to content

Commit

Permalink
skip packet re-sending on error, drop instead
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed May 31, 2017
1 parent b06997a commit 32eee8a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions datadog/dogstatsd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 32eee8a

Please sign in to comment.