[Mailman-Developers] Bugs in Utils.py and pythonlib/smtplib.py (Mailman 1.1)

Harald Meland Harald.Meland@usit.uio.no
09 May 2000 19:35:47 +0200


--=-=-=

[Dan A. Dickey]

> Here are a couple of patches

Thanks!

> to fix file descriptor leaks in Utils.py,

The message delivery stuff has changed a lot since 1.1, so there's no
longer any TrySMTPDelivery() function in Utils.py.

> and pythonlib/smtplib.py.

The modules under Mailman/pythonlib in the distribution are merely
copies of the current version of various modules that accompany python
itself.  Thus, if there are bugs in these modules, they should be
reported to the python maintainers.

In this case, though, I don't think there is a bug per se in the
smtplib library -- rather, it's Mailman that doesn't take enough care
in closing up file descriptors.

Below is a quick patch against current CVS Mailman for those cron
scripts I have seen run out of available file descriptors (when
there's a lot of lists to iterate over).  I don't actually run CVS
Mailman at the moment, so the patch has not been tested.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=mailman-closelogs-cron.diff

? cron/postauthenticate
? cron/preauthenticate
Index: cron/checkdbs
===================================================================
RCS file: /export/public/cvsroot/mailman/cron/checkdbs,v
retrieving revision 1.21
diff -u -r1.21 checkdbs
--- checkdbs	2000/05/08 22:24:42	1.21
+++ checkdbs	2000/05/09 17:29:54
@@ -58,6 +58,7 @@
         finally:
             mlist.Save()
             mlist.Unlock()
+            mlist.CloseLogs()
             
 
 
Index: cron/gate_news
===================================================================
RCS file: /export/public/cvsroot/mailman/cron/gate_news,v
retrieving revision 1.28
diff -u -r1.28 gate_news
--- gate_news	2000/04/07 04:46:30	1.28
+++ gate_news	2000/05/09 17:29:55
@@ -208,6 +208,7 @@
             finally:
                 mlist.Save()
                 mlist.Unlock()
+                mlist.CloseLogs()
                 os._exit(status)
     # we're done forking off all the gating children, now just wait for them
     # all to exit, and then we're done
Index: cron/senddigests
===================================================================
RCS file: /export/public/cvsroot/mailman/cron/senddigests,v
retrieving revision 1.14
diff -u -r1.14 senddigests
--- senddigests	2000/03/21 06:26:25	1.14
+++ senddigests	2000/05/09 17:29:55
@@ -58,6 +58,7 @@
     finally:
         mlist.Save()
         mlist.Unlock()
+        mlist.CloseLogs()
 
 
 

--=-=-=


-- 
Harald

--=-=-=--