[tor-commits] [stem/master] Don't download descriptors from Bifroest

atagar at torproject.org atagar at torproject.org
Sun Apr 29 01:30:18 UTC 2018


commit 63d166481bc39ff4f7c541b28b4310db133b0031
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Apr 28 18:28:00 2018 -0700

    Don't download descriptors from Bifroest
    
    Bifroest frequently times out. As our bridge authority it doesn't vote in the
    consensus, and as such we don't overly care about its reliability as a
    directory mirror. Might as well just not download from it rather than bug isis.
---
 docs/change_log.rst       | 1 +
 stem/descriptor/remote.py | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/docs/change_log.rst b/docs/change_log.rst
index 8bd00d99..d10597ea 100644
--- a/docs/change_log.rst
+++ b/docs/change_log.rst
@@ -60,6 +60,7 @@ The following are only available within Stem's `git repository
   * `Fallback directory v2 support <https://lists.torproject.org/pipermail/tor-dev/2017-December/012721.html>`_, which adds *nickname* and *extrainfo*
   * Added server descriptor's new is_hidden_service_dir attribute
   * Don't retry downloading descriptors when we've timed out
+  * Don't download from tor26 and Bifroest, which are authorities that frequently timeout.
   * `stem.descriptor.remote <api/descriptor/remote.html>`_  now consistently defaults **fall_back_to_authority** to false.
   * Added :func:`~stem.descriptor.remote.their_server_descriptor`
   * Added the reply_headers attribute to :class:`~stem.descriptor.remote.Query`
diff --git a/stem/descriptor/remote.py b/stem/descriptor/remote.py
index d6832eaa..480297f1 100644
--- a/stem/descriptor/remote.py
+++ b/stem/descriptor/remote.py
@@ -494,6 +494,10 @@ class Query(object):
      DirPort to such an extent that requests either time out or take on the
      order of minutes.
 
+  .. versionchanged:: 1.7.0
+     Avoid downloading from Bifroest. This is the bridge authority so it
+     doesn't vote in the consensus, and apparently times out frequently.
+
   :var str resource: resource being fetched, such as '/tor/server/all'
   :var str descriptor_type: type of descriptors being fetched (for options see
     :func:`~stem.descriptor.__init__.parse_file`), this is guessed from the
@@ -696,7 +700,7 @@ class Query(object):
     """
 
     if use_authority or not self.endpoints:
-      picked = random.choice([auth for auth in get_authorities().values() if auth.nickname != 'tor26'])
+      picked = random.choice([auth for auth in get_authorities().values() if auth.nickname not in ('tor26', 'Bifroest')])
       return stem.DirPort(picked.address, picked.dir_port)
     else:
       return random.choice(self.endpoints)



More information about the tor-commits mailing list