Derrick Stolee <sto...@gmail.com> writes: > The (unlikely, but possible) race condition involves two processes (P1 > and P2): > > 1. P1 reads from graph-latest to see commit graph file F1. > 2. P2 updates graph-latest to point to F2 and deletes F1. > 3. P1 tries to read F1 and fails. > > I could explicitly mention this condition in the message, or we can > just let P2 fail by deleting all files other than the one referenced > by 'graph-latest'. Thoughts?
The established way we do this is not to have -latest pointer, I would think, and instead, make -latest be the actual thing. That is how $GIT_DIR/index is updated, for example, by first writing into a temporary file and then moving it to the final destination. Is there a reason why the same pattern cannot be used?