Skip to content

Commit

Permalink
silently drop packets on socket timeout
Browse files Browse the repository at this point in the history
this mimics UDP behaviour for unix socket implementation
  • Loading branch information
xvello committed May 17, 2017
1 parent 344e170 commit b06997a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions datadog/dogstatsd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ def _send_to_server(self, packet):
try:
# If set, use socket directly
(self.socket or self.get_socket()).send(packet.encode(self.encoding))
except socket.timeout:
# dogstatsd is overflowing, drop the packets (mimicks the UDP behaviour)
return
except socket.error:
log.info("Error submitting packet, will try refreshing the socket")

Expand Down

0 comments on commit b06997a

Please sign in to comment.