Re: [PATCH 1/3] refs/reftable: introduce "reftable.lockTimeout"
- From
karthik nayak <karthik.188@gmail.com>
- Date
- Sep 17, 2024, 17:46 UTC
- Message-ID
- <CAOLa=ZTja-nFmKZ8iyyp0szuaAWAnPncy0E6rM5=WWgnr=01uA@mail.gmail.com>
- In-Reply-To
- <ca3eab99f7ef86d1b7a5b4d4bdb8d2b0a55566e1.1726578382.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
[snip]
Show 6 quoted lines
> +reftable.lockTimeout:: > + Whenever the reftable backend appends a new table to the stack, it has > + to lock the central "tables.list" file before updating it. This config > + controls how long the process will wait to acquire the lock in case > + another process has already acquired it. Default is 1000 (i.e., retry > + for 1 second).
Isn't the default 100ms? As that was what was mentioned in the commit message
[snip]
Show 14 quoted lines
> +test_expect_success 'ref transaction: retry acquiring tables.list lock' '
> + test_when_finished "rm -rf repo" &&
> + git init repo &&
> + (
> + cd repo &&
> + test_commit initial &&
> + LOCK=.git/reftable/tables.list.lock &&
> + >$LOCK &&
> + {
> + ( sleep 1 && rm -f $LOCK ) &
> + } &&
> + git -c reftable.lockTimeout=5000 update-ref refs/heads/branch HEAD
> + )
> +'Nit: This does stall the test for 1s. Which is slightly annoying when running single tests locally. Couldn't we achieve this by doing `sleep 0.1`?