Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-existent network error handling in GraphiteReporter #28

Open
edigaryev opened this issue Sep 19, 2016 · 0 comments
Open

Non-existent network error handling in GraphiteReporter #28

edigaryev opened this issue Sep 19, 2016 · 0 comments

Comments

@edigaryev
Copy link

When the remote end closes the connection (e.g. carbon-cache restarts), sendall() throws SIGPIPE:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/utils/periodic.py", line 24, in run
    self.task()
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/reporter/base.py", line 14, in task
    self.write()
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/reporter/graphite.py", line 92, in write
    self._send()
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/reporter/graphite.py", line 133, in _send_plaintext
    self.socket.sendall(self.batch_buffer + "\n")
  File "/usr/lib64/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 32] Broken pipe

ECONNREFUSED is thrown when the remote end isn't accepting connections yet:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/utils/periodic.py", line 24, in run
    self.task()
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/reporter/base.py", line 14, in task
    self.write()
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/reporter/graphite.py", line 92, in write
    self._send()
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/reporter/graphite.py", line 133, in _send_plaintext
    self.socket.sendall(self.batch_buffer + "\n")
  File "/home/user/.local/lib64/python2.7/site-packages/metrology/reporter/graphite.py", line 48, in socket
    self._socket.connect((self.host, self.port))
  File "/usr/lib64/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused

These exceptions cause periodic task (thread) to be terminated with no indication and/or connection retry attempts whatsoever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant