[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r20522: {torctl} Fix sqlalchemy backtrace by adding a "use_labels" (actually (torctl/trunk/python/TorCtl)



Author: mikeperry
Date: 2009-09-10 18:06:24 -0400 (Thu, 10 Sep 2009)
New Revision: 20522

Modified:
   torctl/trunk/python/TorCtl/SQLSupport.py
Log:

Fix sqlalchemy backtrace by adding a "use_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/trunk/python/TorCtl/SQLSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/SQLSupport.py	2009-09-10 22:02:55 UTC (rev 20521)
+++ torctl/trunk/python/TorCtl/SQLSupport.py	2009-09-10 22:06:24 UTC (rev 20522)
@@ -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)