Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions datadog/dogstatsd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,16 +925,13 @@ def set_socket_timeout(self, timeout):
@classmethod
def _ensure_min_send_buffer_size(cls, sock, min_size=MIN_SEND_BUFFER_SIZE):
# type: (_Socket, int) -> None
# Increase the receiving buffer size where needed (e.g. MacOS has 4k RX
# Increase the send buffer size where needed (e.g. MacOS has 4k TX
# buffers which is half of the max packet size that the client will send.
if os.name == 'posix':
try:
recv_buff_size = sock.getsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF)
if recv_buff_size <= min_size:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, min_size)
log.debug("Socket send buffer increased to %dkb", min_size / 1024)
finally:
pass
send_buff_size = sock.getsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF)
if send_buff_size <= min_size:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, min_size)
log.debug("Socket send buffer increased to %dkb", min_size / 1024)

@classmethod
def _get_uds_socket(cls, socket_path, timeout):
Expand Down Expand Up @@ -1110,7 +1107,7 @@ def gauge_with_timestamp(
sample_rate=None, # type: Optional[float]
cardinality=None, # type: Optional[str]
): # type: (...) -> None
"""u
"""
Record the value of a gauge with a Unix timestamp (in seconds),
optionally setting a list of tags and a sample rate.

Expand Down Expand Up @@ -1590,7 +1587,6 @@ def _xmit_packet(self, packet, is_telemetry):
)
self.close_socket()
except Exception as exc:
print("Unexpected error: ", exc)
log.error("Unexpected error: %s", str(exc))

if not is_telemetry and self._telemetry:
Expand Down
Loading