This cache is shared across stores and hence we should take store lock before
writing to it. Otherwise there will be race where one share with wlock is
writing to this cache and other share with wlock is trying to read it
simultaneously.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG64de86fd0984: tags: take lock instead of wlock before writing hgtagsfnodes1 cache
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
This change may break compatibility with older clients. As written, if an old client and modern client write the tags cache file, they will obtain different locks and race to write the tags cache. If we want backwards compatibility, we need to take the store lock in addition to the working directory lock.