From: Patrick Steinhardt <ps@pks.im>
To: Justin Tobler <jltobler@gmail.com>
Cc: git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Wolfgang Kritzinger <wkritzinger@atlassian.com>
Subject: Re: [PATCH 4/5] odb: remove read loop for found objects
Date: Wed, 14 Oct 2026 08:56:08 +0200 [thread overview]
Message-ID: <as8niG1LrNqxfRzV@pks.im> (raw)
In-Reply-To: <as6kNufOqLFeBoNh@denethor>
On Tue, Oct 13, 2026 at 04:48:23PM -0500, Justin Tobler wrote:
> On 26/10/13 09:36AM, Patrick Steinhardt wrote:
> > diff --git a/odb.c b/odb.c
> > index 69a4c203bc..095183aec0 100644
> > --- a/odb.c
> > +++ b/odb.c
> > @@ -265,7 +265,6 @@ static enum odb_read_status do_oid_object_info_extended(struct object_database *
> > struct strbuf corrupt_err = STRBUF_INIT;
> > const struct object_id *real = oid;
> > enum odb_read_status ret;
> > - int already_retried = 0;
> > bool corrupt = false;
> >
> > if (flags & OBJECT_INFO_LOOKUP_REPLACE)
> > @@ -277,38 +276,39 @@ static enum odb_read_status do_oid_object_info_extended(struct object_database *
> > if (!odb_source_read_object_info(odb->inmemory_objects, oid, oi, flags, NULL))
> > return 0;
> >
> > - while (1) {
> > + ret = odb_source_read_object_info(odb->source, real, oi, flags,
> > + &corrupt_err);
>
> Here is try to read the object, the backend is responsible for handling
> any retries internally that it cares about.
>
> > + if (!ret)
> > + goto out;
> > + if (ret != ODB_READ_NOT_FOUND)
> > + corrupt = true;
>
> If the repsitory is correct, does it even make sense to continue to try
> and fetch the missing object? I wonder if we should set `ret =
> ODB_READ_ERROR` and `goto out`?
I think I tend to agree. I don't want to do it as part of this commit
though, which is a plain refactoring that shouldn't change semantics.
I'll add a commit on top though.
Patrick
next prev parent reply other threads:[~2026-10-14 6:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 7:36 [PATCH 0/5] odb/files: cleanups and improvements for alternates Patrick Steinhardt
2026-10-13 7:36 ` [PATCH 1/5] odb/source-files: fix performance when reading objects with alternates Patrick Steinhardt
2026-10-13 20:46 ` Justin Tobler
2026-10-13 7:36 ` [PATCH 2/5] odb/source-files: fix performance when streaming " Patrick Steinhardt
2026-10-13 20:51 ` Justin Tobler
2026-10-13 7:36 ` [PATCH 3/5] odb/source-files: make the second read an implementation detail Patrick Steinhardt
2026-10-13 21:28 ` Justin Tobler
2026-10-14 6:55 ` Patrick Steinhardt
2026-10-13 7:36 ` [PATCH 4/5] odb: remove read loop for found objects Patrick Steinhardt
2026-10-13 21:48 ` Justin Tobler
2026-10-14 6:56 ` Patrick Steinhardt [this message]
2026-10-13 7:36 ` [PATCH 5/5] odb/source: drop `local` flag Patrick Steinhardt
2026-10-13 22:44 ` Justin Tobler
2026-10-14 6:56 ` Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 0/6] odb/files: cleanups and improvements for alternates Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 1/6] odb/source-files: fix performance when reading objects with alternates Patrick Steinhardt
2026-10-14 13:35 ` Johannes Schindelin
2026-10-14 13:44 ` Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 2/6] odb/source-files: fix performance when streaming " Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 3/6] odb/source-files: make the second read an implementation detail Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 4/6] odb: remove read loop for found objects Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 5/6] odb: don't try re-fetching corrupt objects Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 6/6] odb/source: drop `local` flag 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=as8niG1LrNqxfRzV@pks.im \
--to=ps@pks.im \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=jltobler@gmail.com \
--cc=wkritzinger@atlassian.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox