SVN: ZODB/branches/jim-thready/src/ZEO/StorageServer.py Make an assertion mor einformative.

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <20100124190232.A5E2A9417C__39295.7116979689$1264359770$gmane$org@cvs.zope.org>
Log message for revision 108445:
  Make an assertion mor einformative.
  
  Close clients before closing storages to avoid a test race, but
  otherwise makes sense.
  

Changed:
  U   ZODB/branches/jim-thready/src/ZEO/StorageServer.py

-=-
Modified: ZODB/branches/jim-thready/src/ZEO/StorageServer.py
===================================================================
--- ZODB/branches/jim-thready/src/ZEO/StorageServer.py	2010-01-24 18:42:15 UTC (rev 108444)
+++ ZODB/branches/jim-thready/src/ZEO/StorageServer.py	2010-01-24 19:02:32 UTC (rev 108445)
@@ -425,7 +425,7 @@
     def tpc_finish(self, id):
         if not self._check_tid(id):
             return
-        assert self.locked
+        assert self.locked, "finished called wo lock"
 
         self.stats.commits += 1
         self.storage.tpc_finish(self.transaction, self._invalidate)
@@ -1176,8 +1176,6 @@
         self.dispatcher.close()
         if self.monitor is not None:
             self.monitor.close()
-        for storage in self.storages.values():
-            storage.close()
         # Force the asyncore mainloop to exit by hackery, i.e. close
         # every socket in the map.  loop() will return when the map is
         # empty.
@@ -1187,6 +1185,8 @@
             except:
                 pass
         asyncore.socket_map.clear()
+        for storage in self.storages.values():
+            storage.close()
 
     def close_conn(self, conn):
         """Internal: remove the given connection from self.connections.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.