[Zope-Checkins] CVS: ZODB3/ZEO - CommitLog.py:1.4.72.2 StorageServer.py:1.98.4.5

Tim Peters tim.one at comcast.net
Tue Sep 30 11:24:40 EDT 2003


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv26430/ZEO

Modified Files:
      Tag: Zope-2_7-branch
	CommitLog.py StorageServer.py 
Log Message:
A CommitLog instance contains a temp file, but the temp file was never
explicitly closed.  This accounts for the 402 .log files left behind
by the test suite when run under Windows Python 2.2.3.  It also accounts
for many leaking file descriptors Shane saw when creating many
short-lived connections on Linux.

The cure here is to add a CommitLog.close() method, and call it from
ZEOStorage._clear_transaction().  Since a CommitLog instance is only
created by tpc_begin(), a tpc_finish() or tpc_abort() must normally
follow, and both call _clear_transaction().

There's reason to believe that ZEOStorage instances still leak.


=== ZODB3/ZEO/CommitLog.py 1.4.72.1 => 1.4.72.2 ===
--- ZODB3/ZEO/CommitLog.py:1.4.72.1	Mon Sep 15 14:02:59 2003
+++ ZODB3/ZEO/CommitLog.py	Tue Sep 30 11:24:40 2003
@@ -42,3 +42,8 @@
         self.read = 1
         self.file.seek(0)
         return self.stores, cPickle.Unpickler(self.file)
+
+    def close(self):
+        if self.file:
+            self.file.close()
+            self.file = None


=== ZODB3/ZEO/StorageServer.py 1.98.4.4 => 1.98.4.5 ===
--- ZODB3/ZEO/StorageServer.py:1.98.4.4	Tue Sep 23 15:03:31 2003
+++ ZODB3/ZEO/StorageServer.py	Tue Sep 30 11:24:40 2003
@@ -398,6 +398,7 @@
     def _clear_transaction(self):
         # Common code at end of tpc_finish() and tpc_abort()
         self.transaction = None
+        self.txnlog.close()
         if self.locked:
             self.locked = 0
             self.timeout.end(self)




More information about the Zope-Checkins mailing list