You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see cases where exceptions aren't being caught from calls to increment() and other stats reporting functions. According to the code, it's only catching socket.error but there are other errors that can happen, at least in multithreaded applications.
File "/opt/python3.6/lib/python3.6/site-packages/datadog/dogstatsd/base.py", line 153, in increment
self._report(metric, 'c', value, tags, sample_rate)
File "/opt/python3.6/lib/python3.6/site-packages/datadog/dogstatsd/base.py", line 262, in _report
self._send(encoded)
File "/opt/python3.6/lib/python3.6/site-packages/datadog/dogstatsd/base.py", line 267, in _send_to_server
(self.socket or self.get_socket()).send(packet.encode(self.encoding))
AttributeError: 'NoneType' object has no attribute 'send'
I think you should be catching every exception and never letting an exception escape from your code. Otherwise, these types of bugs in dogstats can cause bugs in people's applications if they are using dogstats. As it stands, it looks like the only safe usage appears to be to write a wrapper around dogstats calls to make sure they can never raise exceptions.
The text was updated successfully, but these errors were encountered:
I see cases where exceptions aren't being caught from calls to
increment()
and other stats reporting functions. According to the code, it's only catchingsocket.error
but there are other errors that can happen, at least in multithreaded applications.I think you should be catching every exception and never letting an exception escape from your code. Otherwise, these types of bugs in dogstats can cause bugs in people's applications if they are using dogstats. As it stands, it looks like the only safe usage appears to be to write a wrapper around dogstats calls to make sure they can never raise exceptions.
The text was updated successfully, but these errors were encountered: