[tor-commits] [arm/master] Dropping duplicate geoip failure detection

atagar at torproject.org atagar at torproject.org
Mon Dec 17 04:25:17 UTC 2012


commit f432d8401a8627ac0ed3d430d70b39465804f956
Author: Damian Johnson <atagar at torproject.org>
Date:   Tue Dec 11 19:57:37 2012 -0800

    Dropping duplicate geoip failure detection
    
    Stem provides similar detection to what we had for geoip unavailability, so
    using that.
---
 armrc.sample         |    1 -
 src/util/torTools.py |   12 ++----------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/armrc.sample b/armrc.sample
index c38bcfc..8447134 100644
--- a/armrc.sample
+++ b/armrc.sample
@@ -313,7 +313,6 @@ log.hostnameCacheTrimmed INFO
 log.cursesColorSupport INFO
 log.bsdJailFound INFO
 log.unknownBsdJailId WARN
-log.geoipUnavailable WARN
 log.stats.failedProcResolution DEBUG
 log.stats.procResolutionFailover INFO
 log.stats.failedPsResolution INFO
diff --git a/src/util/torTools.py b/src/util/torTools.py
index 742ea94..9e9e860 100644
--- a/src/util/torTools.py
+++ b/src/util/torTools.py
@@ -79,8 +79,7 @@ CONFIG = {"torrc.map": {},
           "log.torSetConf": log.INFO,
           "log.torPrefixPathInvalid": log.NOTICE,
           "log.bsdJailFound": log.INFO,
-          "log.unknownBsdJailId": log.WARN,
-          "log.geoipUnavailable": log.WARN}
+          "log.unknownBsdJailId": log.WARN}
 
 # events used for controller functionality:
 # NOTICE - used to detect when tor is shut down
@@ -90,10 +89,6 @@ REQ_EVENTS = {"NOTICE": "this will be unable to detect when tor is shut down",
               "NS": "information related to the consensus will grow stale",
               "NEWCONSENSUS": "information related to the consensus will grow stale"}
 
-# number of sequential attempts before we decide that the Tor geoip database
-# is unavailable
-GEOIP_FAILURE_THRESHOLD = 5
-
 # provides int -> str mappings for torctl event runlevels
 TORCTL_RUNLEVELS = dict([(val, key) for (key, val) in TorUtil.loglevels.items()])
 
@@ -630,9 +625,6 @@ class Controller(TorCtl.PostEventListener):
     # directs TorCtl to notify us of events
     TorUtil.logger = self
     TorUtil.loglevel = "DEBUG"
-    
-    # tracks the number of sequential geoip lookup failures
-    self.geoipFailureCount = 0
   
   def init(self, conn, controller):
     """
@@ -1158,7 +1150,7 @@ class Controller(TorCtl.PostEventListener):
     false otherwise.
     """
     
-    return self.geoipFailureCount == GEOIP_FAILURE_THRESHOLD
+    return self.controller.is_geoip_unavailable()
   
   def getMyPid(self):
     """





More information about the tor-commits mailing list