All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Justin Tobler <jltobler@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 1/4] loose: use finite timeout when locking "loose-object-idx" file
Date: Thu, 29 Oct 2026 09:05:42 +0100	[thread overview]
Message-ID: <auL-Ta8DTicSLW7W@pks.im> (raw)
In-Reply-To: <20261029002413.3291184-2-jltobler@gmail.com>

On Wed, Oct 28, 2026 at 07:24:10PM -0500, Justin Tobler wrote:
> Loose object index file writers first attempt to acquire a lock via
> `repo_hold_lock_file_for_update_timeout()` and specify a timeout value
> of -1. With a negative timeout value, the lock acquisition retries
> indefinitely while the lockfile still exists. If a process dies while
> holding the lock and leaves a stale lockfile behind, every subsequent
> writer of the mapping file hangs forever instead of reporting an error.
> 
> Introduce LOOSE_OBJECT_IDX_LOCK_TIMEOUT_MS to set the timeout to 1000ms
> and use it for all callers that lock a "loose-object-idx" file. A value
> of 1000ms matches the default timeout used for "core.packedRefsTimeout"
> and should provide concurrent writers sufficient time to acquire the
> lock.

Right, aborting eventually is way better compared to blocking
indefinitely. Ideally we should also make this setting configurable. But
I think it's fine to skip that for now and fix that at a later point in
time.

Patrick

  reply	other threads:[~2026-10-29  8:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 23:40 [PATCH] tmp-objdir: merge loose object index when migrating tmpdir Justin Tobler
2026-10-23 12:19 ` Patrick Steinhardt
2026-10-23 21:25   ` Justin Tobler
2026-10-26  6:39     ` Patrick Steinhardt
2026-10-26 17:58       ` Justin Tobler
2026-10-29  0:24 ` [PATCH v2 0/4] loose: fix migrating "loose-object-idx" with batch fsync Justin Tobler
2026-10-29  0:24   ` [PATCH v2 1/4] loose: use finite timeout when locking "loose-object-idx" file Justin Tobler
2026-10-29  8:05     ` Patrick Steinhardt [this message]
2026-10-29  0:24   ` [PATCH v2 2/4] loose: lift loose object index parsing logic into helper Justin Tobler
2026-10-29  8:05     ` Patrick Steinhardt
2026-10-29  0:24   ` [PATCH v2 3/4] loose: lift loose object index writing " Justin Tobler
2026-10-29  8:05     ` Patrick Steinhardt
2026-10-29  0:24   ` [PATCH v2 4/4] tmp-objdir: merge loose object index when migrating tmpdir Justin Tobler
2026-10-29  8:05     ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auL-Ta8DTicSLW7W@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.