Skip to content

Commit

Permalink
Adds some extra description to socket errors in order to distinguish …
Browse files Browse the repository at this point in the history
…similar errors
  • Loading branch information
scottopell committed Oct 12, 2023
1 parent 9e389ff commit bc3fc1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datadog/dogstatsd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def _get_uds_socket(cls, socket_path, timeout):
def _get_udp_socket(cls, host, port, timeout):
log.debug("Connecting to %s:%s", host, port)
addrinfo = socket.getaddrinfo(host, port, 0, socket.SOCK_DGRAM)
# Override gai.conf order for backwrads compatibility: prefer
# Override gai.conf order for backwards compatibility: prefer
# v4, so that a v4-only service on hosts with both addresses
# still works.
addrinfo.sort(key=lambda v: v[0] == socket.AF_INET, reverse=True)
Expand Down Expand Up @@ -1012,7 +1012,7 @@ def _xmit_packet(self, packet, is_telemetry):
pass
except (socket.herror, socket.gaierror) as socket_err:
log.warning(
"Error submitting packet: %s, dropping the packet and closing the socket",
"Address-related error submitting packet: %s, dropping the packet and closing the socket.",
socket_err,
)
self.close_socket()
Expand Down

0 comments on commit bc3fc1a

Please sign in to comment.