changeset 8130:9056b0c8fcd6 permission-performance

Fix file descriptor leak in anydbm This didn't close a local dbm file on error. Visible only when tests are run on an NFS mount.
author Ralf Schlatterbeck <rsc@runtux.com>
date Tue, 22 Oct 2024 12:57:32 +0200
parents 627871650f4f
children 8e9181dfc9fa
files roundup/backends/back_anydbm.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py	Tue Oct 22 12:04:50 2024 +0200
+++ b/roundup/backends/back_anydbm.py	Tue Oct 22 12:57:32 2024 +0200
@@ -408,11 +408,13 @@
         if db is None:
             db = self.getclassdb(classname)
         if nodeid not in db:
+            db.close()
             raise IndexError("no such %s %s" % (classname, nodeid))
 
         # check the uncommitted, destroyed nodes
         if (classname in self.destroyednodes and
                 nodeid in self.destroyednodes[classname]):
+            db.close()
             raise IndexError("no such %s %s" % (classname, nodeid))
 
         # decode

Roundup Issue Tracker: http://roundup-tracker.org/