Wed, 01 Mar 2023 16:48:09 +0100 rhg: remember the inode of .hg/dirstate stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 01 Mar 2023 16:48:09 +0100] rev 49703
rhg: remember the inode of .hg/dirstate This allows us to detect changes of `.hg/dirstate`, which is either the full dirstate (in dirstate-v1) or the docket file (v2) without relying on data inside the file. It only works on UNIX systems. This fixes a race condition for dirstate-v1 (as demonstrated by the test changes) and adds a confortable layer of sanity for dirstate-v2.
Tue, 28 Feb 2023 17:58:15 +0100 rust-dirstate-v2: don't write dirstate if data file has changed stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 28 Feb 2023 17:58:15 +0100] rev 49702
rust-dirstate-v2: don't write dirstate if data file has changed This fixes the following race: - process A reads the dirstate - process B reads and writes the dirstate - process A writes the dirstate This either resulted in losing what process B had just written or a crash because the `uuid` had changed and we were trying to write to a file that doesn't exist. More explanations inside. This doesn't fix the issue for dirstate-v1, a later patch addresses it.
Mon, 12 Dec 2022 17:08:12 +0100 rust-dirstate: remember the data file uuid dirstate was loaded with stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 12 Dec 2022 17:08:12 +0100] rev 49701
rust-dirstate: remember the data file uuid dirstate was loaded with This will be used in the next patch to fix a race condition.
Wed, 01 Mar 2023 02:38:20 +0100 dirstate: set identity whenever we read the dirstate's v2 docket stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 01 Mar 2023 02:38:20 +0100] rev 49700
dirstate: set identity whenever we read the dirstate's v2 docket The docket can be loaded outside of a full read (for exemple when pre-fetching parents), so the current code would read/set the identity after loading the data, opening a race condition: A0: first process docket is read B0: other process appends new data to the dirstate (and changes the docket) A1: first process sets the identity (based on pre-B content, but with post-B identity) A1: first process loads the dirstatemap from the data file A1: first process does not detect the race and overwrites the update from B.
Tue, 21 Feb 2023 15:10:12 +0100 dirstate: factor the identity setting code in the dirstate map stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 15:10:12 +0100] rev 49699
dirstate: factor the identity setting code in the dirstate map We need it in more locations, so let us start factoring thing out first to make sure the same code is called everywhere. This bears some similarity with 85746485a4dd on default, but at a smaller scope and for a different purpose.
Wed, 01 Mar 2023 00:07:26 +0100 dirstate: simplify the dirstate's read race testing stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 01 Mar 2023 00:07:26 +0100] rev 49698
dirstate: simplify the dirstate's read race testing Now that most code behaves properly, we can simplify the expected matching.
Tue, 28 Feb 2023 19:36:46 +0100 dirstate: deal with read-race for pure rust code path (rhg) stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 28 Feb 2023 19:36:46 +0100] rev 49697
dirstate: deal with read-race for pure rust code path (rhg) If we cannot read the dirstate data, this is probably because a writing process wrote it under our feet. So refresh the docket and try again a handful of time.
Tue, 28 Feb 2023 23:35:52 +0100 dirstate: deal with read-race for python code using rust object stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 28 Feb 2023 23:35:52 +0100] rev 49696
dirstate: deal with read-race for python code using rust object If we cannot read the dirstate data, this is probably because a writing process wrote it under our feet. So refresh the docket and try again a handful of time.
Tue, 28 Feb 2023 19:01:20 +0100 dirstate: deal with read-race for pure python code stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 28 Feb 2023 19:01:20 +0100] rev 49695
dirstate: deal with read-race for pure python code If we cannot read the dirstate data, this is probably because a writing process wrote it under our feet. So refresh the docket and try again a handful of time.
Wed, 01 Mar 2023 16:05:28 +0100 dirstate: abstract the reading of the data file in v2 in a method stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 01 Mar 2023 16:05:28 +0100] rev 49694
dirstate: abstract the reading of the data file in v2 in a method We will need more changes to avoid some race conditions during read, so we first isolate the simple logic before making it more complicated.
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 tip