git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: gitgitgadget@gmail.com
Cc: git@vger.kernel.org, jonathantanmy@google.com, me@ttaylorr.com,
	dstolee@microsoft.com
Subject: Re: [PATCH] connected.c: reprepare packs for corner cases
Date: Thu, 12 Mar 2020 09:39:39 -0700	[thread overview]
Message-ID: <20200312163939.176298-1-jonathantanmy@google.com> (raw)
In-Reply-To: <pull.579.git.1584027403779.gitgitgadget@gmail.com>

> Placing a reprepare_packed_git() call inside chck_connected() before
> looping through the packed_git list seems like the safest way to
> avoid this issue in the future. While reprepare_packed_git() does
> another scan of the pack directory, it is not terribly expensive as
> long as we do not run it in a loop. We check connectivity only a
> few times per command, so this will not have a meaningful performance
> impact. In exchange, we get extra safety around this check.

This also means that check_connected() now does the equivalent of
reprepare_packed_git() in both its branches (the rev-list one, which
spawns a new process and thus rereads the pack directory, and the fast
one). This will at least help callers to reason about its behavior more
simply, so it sounds like a good change to me.

>     I included how I found this (integrating v2.26.0-rc0 into Scalar), but I
>     am able to reproduce it on my Linux machine using real fetches from
>     github.com. I'm not sure why I was unable to reproduce the issue in test
>     cases using the file:// URLs or the HTTP tests.

If you remember how to reproduce it using real fetches from github.com,
could you give us reproduction steps?

Thanks for attempting to reproduce it in a test script.

> diff --git a/connected.c b/connected.c
> index 7e9bd1bc622..ac52b07b474 100644
> --- a/connected.c
> +++ b/connected.c
> @@ -61,7 +61,11 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
>  		 * object is a promisor object. Instead, just make sure we
>  		 * received, in a promisor packfile, the objects pointed to by
>  		 * each wanted ref.
> +		 *
> +		 * Before checking for promisor packs, be sure we have the
> +		 * latest pack-files loaded into memory.
>  		 */
> +		reprepare_packed_git(the_repository);
>  		do {
>  			struct packed_git *p;

The code itself looks good to me.

  reply	other threads:[~2020-03-12 16:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 15:36 [PATCH] connected.c: reprepare packs for corner cases Derrick Stolee via GitGitGadget
2020-03-12 16:39 ` Jonathan Tan [this message]
2020-03-12 17:34   ` Derrick Stolee
2020-03-12 20:42 ` Junio C Hamano
2020-03-12 21:16   ` Jeff King
2020-03-12 21:26     ` Jeff King
2020-03-13  0:54       ` Derrick Stolee
2020-03-13  1:14         ` Junio C Hamano
2020-03-13  2:30         ` Jeff King
2020-03-13  2:34           ` Jeff King
2020-03-13 12:43             ` Derrick Stolee
2020-03-13 21:11 ` [PATCH v2] " Derrick Stolee via GitGitGadget

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200312163939.176298-1-jonathantanmy@google.com \
    --to=jonathantanmy@google.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=me@ttaylorr.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).