[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/zrpc/trigger.py Fixed a unix file descriptor leak.

Jim Fulton jim at zope.com
Fri Dec 18 14:54:37 EST 2009


Log message for revision 106766:
  Fixed a unix file descriptor leak.
  

Changed:
  U   ZODB/trunk/src/ZEO/zrpc/trigger.py

-=-
Modified: ZODB/trunk/src/ZEO/zrpc/trigger.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/trigger.py	2009-12-18 19:54:35 UTC (rev 106765)
+++ ZODB/trunk/src/ZEO/zrpc/trigger.py	2009-12-18 19:54:37 UTC (rev 106766)
@@ -137,13 +137,15 @@
 
         def __init__(self, map=None):
             _triggerbase.__init__(self)
-            r, self.trigger = self._fds = os.pipe()
+            r, self.trigger = os.pipe()
             asyncore.file_dispatcher.__init__(self, r, map)
 
+            # file_dispatcher dups r, so we don't need it any more
+            os.close(r)
+
         def _close(self):
-            for fd in self._fds:
-                os.close(fd)
-            self._fds = []
+            os.close(self.trigger)
+            asyncore.file_dispatcher.close(self)
 
         def _physical_pull(self):
             os.write(self.trigger, 'x')



More information about the Zodb-checkins mailing list