Re: [PATCH v1 16/19] read-cache: unlink old sharedindex files
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 29, 2016, 03:30 UTC
- Message-ID
- <CACsJy8BU4EH=yzkEFzTPJSQ61HMJWVperjf67L9JK9bqeUEC4A@mail.gmail.com>
- In-Reply-To
- <xmqq4m3x93e1.fsf@gitster.mtv.corp.google.com>
On Thu, Oct 27, 2016 at 11:13 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
>> git-gc just can't match this because while it's running, somebody else
>> may be updating $GIT_DIR/index. Handling races would be a lot harder.
>
> It could attempt to take a lock on the primary index while it runs,
> and refrain to do anything if it can't take the lock ("gc --auto"
> may want to silently retry), and then the race is no longer an
> issue, no?No, I thought of that. But if gc is holding the lock, another program that wants to update the index may fail. And git-gc is supposed to be non-intrusive
-- Duy