transaction: fix file descriptor leak for journal.backupfiles stable
authorDurham Goode <durham@fb.com>
Wed, 30 Apr 2014 15:36:38 -0700
branchstable
changeset 21206 c77418938d05
parent 21205 e2031c8ca4f8
child 21207 b9defeeb62e6
transaction: fix file descriptor leak for journal.backupfiles The journal.backupfiles descriptor wasn't being closed. This resulted in hgsubversion test runs having a bagillion descriptors open, which crashed on platforms with low open file limits (like OSX).
mercurial/transaction.py
--- a/mercurial/transaction.py	Fri Apr 25 18:00:07 2014 -0700
+++ b/mercurial/transaction.py	Wed Apr 30 15:36:38 2014 -0700
@@ -220,6 +220,7 @@
         if self.count != 0:
             return
         self.file.close()
+        self.backupsfile.close()
         self.entries = []
         if self.after:
             self.after()
@@ -243,6 +244,7 @@
         self.count = 0
         self.usages = 0
         self.file.close()
+        self.backupsfile.close()
 
         if self.onabort is not None:
             self.onabort()