annotate .hgtags @ 1233:0d0132cba155

editor: fix edge case with in memory file-store size limit There are a few cases where we will set a single file into to the editor's FileStore object more than once. Notably, for copied and then modified files, we will set it at least twice. Three times if editing fails (which it can for symlinks). If we pass the in-memory storage limit in between the first (or second if editing fails) time we set the file and the last time we set the file, we will write the data to the in memory store the first time and the file store the last time. We didn't remove it form the in-memory store though, and we always prefer reading from the in-memory store. This means we can sometimes end up with the wrong version of a file. This is fairly unlikely to happen in normal use since you need to hit the memory limit between two writes to the store for the same file. We only write a file multiple times if a) the file (and not one of it's parent directories) is copied and then modified or b) editing fails. From what I can tell, it's only common for editing to fail for symlinks, and they ten to be relatively small data that is unlikely to push over the limit. Finally, the default limit is 100MB which I would expect to be most often either well over (source code) or well under (binaries or automated changes) the size of the changes files in a single commit. The easiest way to reproduce this is to set the in-memory cache size to 0 and then commit a copied and modified symlink. The empty-string version from the failed editing will be the one that persists. I happened to stumble upon this while trying (and failing) to test a bug-fix for a related bug with identical symptoms (empty simlink). I have seen this in the wild, once, but couldn't reproduce it at the time. The repo in question is quite large and quite active, so I am quite confident in my estimation that this is a real, but very rare, problem. The test changes attached to this was mneant to test a related bug, but turned out not to actually cover the bug in question. They did trigger this bug though, and are worthwhile to test, so I kept them.
author David Schleimer <dschleimer@fb.com>
date Mon, 07 Apr 2014 17:51:59 -0700
parents 5c2917375961
children ee4d0f91eaf9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
554
d2d5c09b33d0 Added tag 1.0 for changeset 97f2079e3778
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
1 97f2079e3778511944ffb6a662520580650a3993 1.0
564
7bd457ec4e5e Added tag 1.0.1 for changeset 09c016174e33
Augie Fackler <durin42@gmail.com>
parents: 554
diff changeset
2 09c016174e332eceda015d3f43d96d7e0228acf3 1.0.1
592
b4c3afc95420 Added tag 1.1 for changeset 4359ddd73b00
Augie Fackler <durin42@gmail.com>
parents: 564
diff changeset
3 4359ddd73b009fbb356c52ea5d99cba25222ee7a 1.1
627
faba8e636960 Added tag 1.1.1 for changeset 8e621dbb82d4
Augie Fackler <durin42@gmail.com>
parents: 592
diff changeset
4 8e621dbb82d4363a85317638ad237e2817c56347 1.1.1
631
493023041e74 Added tag 1.1.2 for changeset 093ae2915b45
Augie Fackler <durin42@gmail.com>
parents: 627
diff changeset
5 093ae2915b452539b44390ee4ea14987484e1eee 1.1.2
738
2ddb95cd36dd Added tag 1.2 for changeset 708234ad6c97
Augie Fackler <durin42@gmail.com>
parents: 631
diff changeset
6 708234ad6c97fb52417e0b46a86c8373e25123a5 1.2
788
836aa282f1f8 Added tag 1.2.1 for changeset 4bbc6bf947f5
Augie Fackler <durin42@gmail.com>
parents: 738
diff changeset
7 4bbc6bf947f56a92e95a04a27b94a9f72d5482d7 1.2.1
838
efc86b40e915 Added tag 1.3 for changeset 0cbf9fd89672
Augie Fackler <durin42@gmail.com>
parents: 788
diff changeset
8 0cbf9fd89672e73165e1bb4db1ec8f7f65b95c94 1.3
883
78ffbe411695 Added tag 1.4 for changeset 07234759a3f7
Augie Fackler <raf@durin42.com>
parents: 838
diff changeset
9 07234759a3f750029ccaa001837d42fa12dd33ee 1.4
972
109c412ecf12 Added tag 1.5 for changeset 77b22e5b4ea6
Augie Fackler <raf@durin42.com>
parents: 883
diff changeset
10 77b22e5b4ea6c248e079afd0f1e544cb5690ce20 1.5
1020
b5b1fce26f1f Added tag 1.5.1 for changeset d0f3a5c2cb56
Augie Fackler <raf@durin42.com>
parents: 972
diff changeset
11 d0f3a5c2cb56ce65d9ef1c611c8bfbebdc3bef34 1.5.1
1105
00193337d7f3 Added tag 1.6 for changeset 7d47a0f73135
Augie Fackler <raf@durin42.com>
parents: 1020
diff changeset
12 7d47a0f731354505ed9ae8d60d2a6996e8c3294f 1.6
1178
41ff2014d125 Added tag 1.6.1 for changeset 8caf1226adec
Augie Fackler <raf@durin42.com>
parents: 1020
diff changeset
13 8caf1226adecb322e90ddb3817c604fa2fe8a66d 1.6.1
1226
5cdc58c1c9a7 Added tag 1.6.2 for changeset 36f6d51b4edc
Augie Fackler <raf@durin42.com>
parents: 1178
diff changeset
14 36f6d51b4edc31f1f9ce2d0d02965a85dd26a455 1.6.2
1230
807c443928d4 Added tag 1.6.3 for changeset 46523cdfd3b0
Augie Fackler <raf@durin42.com>
parents: 1226
diff changeset
15 46523cdfd3b0cee0bf1366ab587686bb65211747 1.6.3