Catch DNS-related unhandled exception
I've been running sbws for about 5 days without checking on it.
The first time the following exception appeared in my logs, I went from seeing a variety of thread names in the logs to only seeing a couple. This indicates to me this is (a/the) exception that has been causing sbws to fallback to just one measurement thread. (Later instances of this exception don't change anything)
2018-10-21 11:09:45,926 ERROR Thread-6 scanner.py:259 - dispatch_worker_thread - Unhandled exception in worker thread
Traceback (most recent call last):
File "/home/mtraudt/.pyenv/versions/3.5.6/envs/sbws-venv-3.5.6/lib/python3.5/site-packages/sbws/core/scanner.py", line 257, in dispatch_worker_thread
return measure_relay(*a, **kw)
File "/home/mtraudt/.pyenv/versions/3.5.6/envs/sbws-venv-3.5.6/lib/python3.5/site-packages/sbws/core/scanner.py", line 171, in measure_relay
dest = destinations.next()
File "/home/mtraudt/.pyenv/versions/3.5.6/envs/sbws-venv-3.5.6/lib/python3.5/site-packages/sbws/lib/destination.py", line 251, in next
self._perform_usability_test()
File "/home/mtraudt/.pyenv/versions/3.5.6/envs/sbws-venv-3.5.6/lib/python3.5/site-packages/sbws/lib/destination.py", line 182, in _perform_usability_test
possible_exits = [e for e in self._rl.exits
File "/home/mtraudt/.pyenv/versions/3.5.6/envs/sbws-venv-3.5.6/lib/python3.5/site-packages/sbws/lib/destination.py", line 183, in <listcomp>
if e.can_exit_to(dest.hostname, dest.port)]
File "/home/mtraudt/.pyenv/versions/3.5.6/envs/sbws-venv-3.5.6/lib/python3.5/site-packages/sbws/lib/relaylist.py", line 123, in can_exit_to
host = resolve(host)[0]
File "/home/mtraudt/.pyenv/versions/3.5.6/envs/sbws-venv-3.5.6/lib/python3.5/site-packages/sbws/globals.py", line 71, in resolve
for result in socket.getaddrinfo(hostname, 0):
File "/home/mtraudt/.pyenv/versions/3.5.6/lib/python3.5/socket.py", line 733, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
2018-10-21 11:09:45,926 ERROR Thread-10 scanner.py:314 - closure - Unhandled exception caught while measuring ViDiSrv: <class 'socket.gaierror'> [Errno -2] Name or service not known
Branch incoming.