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

Error handling for Network Unreachable #72

Closed
shader opened this issue May 13, 2015 · 4 comments
Closed

Error handling for Network Unreachable #72

shader opened this issue May 13, 2015 · 4 comments

Comments

@shader
Copy link
Contributor

shader commented May 13, 2015

If the network goes down for some reason, zbeacon produces the following error message:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/pyre/zbeacon.py", line 204, in __init__
    self.run()
  File "/usr/lib64/python2.7/site-packages/pyre/zbeacon.py", line 398, in run
    self.send()
  File "/usr/lib64/python2.7/site-packages/pyre/zbeacon.py", line 338, in send
    self._udp_sock.sendto(self.transmit, (str(self.announce_address), self._port))
error: [Errno 101] Network is unreachable

What is the proper way to provide error handling for this situation? I'd like to implement something like sleep + retry, but I could imagine others wanting to provide a different handler.

@sphaero
Copy link
Contributor

sphaero commented May 14, 2015

I'm not sure yet what is best. Best is to close the socket and try to open a new one. Or close the zbeacon instance and create a new one. Best is to mimic behaviour of zyre?

@shader
Copy link
Contributor Author

shader commented May 14, 2015

Where is the right place to catch the exception, since it's occurring on a different thread?

@sphaero
Copy link
Contributor

sphaero commented May 22, 2015

At the send. Usually you get the exception when you try to do a send. This is where you'd need to intervene

@sphaero
Copy link
Contributor

sphaero commented May 22, 2015

duplicate of #1, please add comments there

@sphaero sphaero closed this as completed May 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants