This is an archive of the discontinued Mercurial Phabricator instance.

persistent-nodemap: introduce a test to highlight possible race
ClosedPublic

Authored by marmoute on Sep 21 2021, 5:51 PM.

Details

Summary

Weakness in the current file caching of the changelog means that a writer can
end up using an outdated docket. This might result in "committed"
persistent-nodemap data from a previous writer to be overwritten by a later
writer. This break the strong "append only" assumption of the persistent nodemap
and can result in confused reader.

The race windows are quite narrow. See the test documentation for details.

The issues is fixed in the next changeset.

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

marmoute created this revision.Sep 21 2021, 5:51 PM
Alphare accepted this revision.Sep 22 2021, 5:29 AM
Alphare added a subscriber: Alphare.

This turned out simpler than I thought first going into this. I only have a small nit.

tests/test-persistent-nodemap.t
781

nit: this should have (known-bad-output !) to make it more obvious

This revision is now accepted and ready to land.Sep 22 2021, 5:29 AM
marmoute updated this revision to Diff 30400.Sep 24 2021, 12:43 PM