Page MenuHomePhabricator

status: use filesystem time boundary to invalidate racy mtime
ClosedPublic

Authored by marmoute on Nov 24 2021, 6:12 AM.

Details

Summary

We record the filesystem time at the start of the status walk and use that as a
boundary to detect files that might be modified during (or right after) the
status run without the mtime allowing that edition to be detected. We
currently do this at a second precision. In a later patch, we will use
nanosecond precision when available.

To cope with "broken" time on the file system where file could be in the
future, we also keep mtime for file over one day in the future. See inline
comment for details.

Large file tests get a bit more confused as we reduce the odds for race
condition.

As a "side effect", the win32text extension is happy again.

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.Nov 24 2021, 6:12 AM
Alphare requested changes to this revision.Nov 24 2021, 8:48 AM
Alphare added a subscriber: Alphare.

Please do a typo pass on the commit message as discussed in IRC

This revision now requires changes to proceed.Nov 24 2021, 8:48 AM
marmoute retitled this revision from status: use filesystem time boundary to invalidate racy files to status: use filesystem time boundary to invalidate racy mtime.Nov 30 2021, 6:54 PM
marmoute edited the summary of this revision. (Show Details)
marmoute updated this revision to Diff 31229.
Alphare accepted this revision.Dec 1 2021, 5:24 AM
This revision is now accepted and ready to land.Dec 1 2021, 5:24 AM
marmoute updated this revision to Diff 31236.Dec 1 2021, 8:21 AM