journal: do not use atomictemp (issue5338)
authorJun Wu <quark@fb.com>
Thu, 24 Aug 2017 21:43:54 -0700
changeset 33941 e6d421566906
parent 33940 1a6707b43d05
child 33942 b9101467d88b
journal: do not use atomictemp (issue5338) Writing journal files using `atomictemp` leads to quadratic performance that could be problematic if automation runs many commands. Other logs like blackbox does not use atomictemp, and journal logs are not critical for repo correctness. So let's make them non-atomictemp. Differential Revision: https://phab.mercurial-scm.org/D517
hgext/journal.py
--- a/hgext/journal.py	Tue Aug 22 14:26:25 2017 -0400
+++ b/hgext/journal.py	Thu Aug 24 21:43:54 2017 -0700
@@ -342,7 +342,7 @@
         with self.jlock(vfs):
             version = None
             # open file in amend mode to ensure it is created if missing
-            with vfs('namejournal', mode='a+b', atomictemp=True) as f:
+            with vfs('namejournal', mode='a+b') as f:
                 f.seek(0, os.SEEK_SET)
                 # Read just enough bytes to get a version number (up to 2
                 # digits plus separator)