Appending to an atomictemp file means that the entire file is copied first.
Thanks to Yuya for suggesting.
Details
- Reviewers
baymax - Group Reviewers
hg-reviewers
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -486,7 +486,7 @@if self.addls: # if we have just new entries, let's append them to the fncache tr.addbackup('fncache')
- fp = self.vfs('fncache', mode='ab', atomictemp=True)
+ fp = self.vfs('fncache', mode='ab')
Ah, no. addbackup() creates hardlink, which means fncache can't be updated in
place. Also, the reader wouldn't handle partially-written fncache well.
Read locks! was there a previous attempt on implementing them? I will try to take a shot at implementing them. I am unable to find any good detail except mentions in wiki or mailing list archive.
> As I said, we'll also need to somehow hide partial data from another > reader processes. There's no read lock. Read locks! was there a previous attempt on implementing them? I will try to take a shot at implementing them. I am unable to find any good detail except mentions in wiki or mailing list archive.
Another option is to ignore trailing data after \n. That's how the revlog
parser gets around partially-written entry.
In either way, writing fncache non-atomically wouldn't be strictly compatible
with older hg clients. I think that's okayish, but I should note that.
There seems to have been no activities on this Diff for the past 3 Months.
By policy, we are automatically moving it out of the need-review state.
Please, move it back to need-review without hesitation if this diff should still be discussed.
:baymax:need-review-idle: