[or-cvs] r20521: {torctl} Fix sqlalchemy backtrace by adding a "using_labels" (actuall (torctl/branches/stable/python/TorCtl)

mikeperry at seul.org mikeperry at seul.org
Thu Sep 10 22:02:56 UTC 2009


Author: mikeperry
Date: 2009-09-10 18:02:55 -0400 (Thu, 10 Sep 2009)
New Revision: 20521

Modified:
   torctl/branches/stable/python/TorCtl/SQLSupport.py
Log:

Fix sqlalchemy backtrace by adding a "using_labels" (actually
with_labels()) option to one of the queries it crashed out
on. The backtrace is rare, so who knows if this is the real
fix. It at least doesn't seem to break things though.



Modified: torctl/branches/stable/python/TorCtl/SQLSupport.py
===================================================================
--- torctl/branches/stable/python/TorCtl/SQLSupport.py	2009-09-10 21:18:28 UTC (rev 20520)
+++ torctl/branches/stable/python/TorCtl/SQLSupport.py	2009-09-10 22:02:55 UTC (rev 20521)
@@ -667,8 +667,8 @@
       rc = self.consensus.routers[idhex]
       if rc.down: continue
       r = Router.query.options(eagerload('bw_history')).filter_by(
-                                  idhex=idhex).one()
-      bwh = BwHistory(router=r, rank=rc.list_rank, bw=rc.bw, 
+                                  idhex=idhex).with_labels().one()
+      bwh = BwHistory(router=r, rank=rc.list_rank, bw=rc.bw,
                       pub_time=r.published)
       r.bw_history.append(bwh)
       #tc_session.add(bwh)



More information about the tor-commits mailing list