commit 1e61af0700112e11effe7619fe40b1b416b153e4 Author: Damian Johnson atagar@torproject.org Date: Sun May 27 12:17:54 2018 -0700
Report fallback directory DirPort failures
The whole point of our fallback directory daemon is to tell us how many fallbacks are unusable, but now that one of their DirPorts is misbehaving it's resulting in uncaught exceptions. Interestingly, we're getting quite a range...
Traceback (most recent call last): File "fallback_directories.py", line 82, in <module> main() File "fallback_directories.py", line 57, in main downloader.get_consensus(endpoints = [(relay.address, relay.dir_port)]).run() File "/home/atagar/Desktop/tor/doctor/stem/descriptor/remote.py", line 445, in run return list(self._run(suppress)) File "/home/atagar/Desktop/tor/doctor/stem/descriptor/remote.py", line 456, in _run raise self.error HTTPError: HTTP Error 404: Not Found
... as well as...
HTTPError: HTTP Error 503: Directory busy, try again later
... or...
CertificateError: hostname '85.214.62.48' doesn't match either of 'andamur.com', 'www.andamur.com'
Our DescriptorDownloader raises an unpleasantly large array of exceptions so unfortunately requires a catch-all here (maybe I'll change that at some point in stem...). --- fallback_directories.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/fallback_directories.py b/fallback_directories.py index 3e4ce06..073fc85 100755 --- a/fallback_directories.py +++ b/fallback_directories.py @@ -53,10 +53,14 @@ def main(): issues.append('%s => IPv6 ORPort is unreachable (%s:%i)' % (relay.fingerprint, relay.orport_v6[0], relay.orport_v6[1])) continue
- start = time.time() - downloader.get_consensus(endpoints = [(relay.address, relay.dir_port)]).run() - download_time = time.time() - start - log.info('%s download time was %0.1f seconds' % (relay.fingerprint, download_time)) + try: + start = time.time() + downloader.get_consensus(endpoints = [(relay.address, relay.dir_port)]).run() + download_time = time.time() - start + log.info('%s download time was %0.1f seconds' % (relay.fingerprint, download_time)) + except Exception as exc: + issues.append('%s => Unable to download from DirPort (%s)' % (relay.fingerprint, exc)) + continue
if download_time > 15: issues.append('%s => Downloading the consensus took %0.1f seconds' % (relay.fingerprint, download_time))
tor-commits@lists.torproject.org