From: Junio C Hamano <gitster@pobox•com>
To: Jacob Keller <jacob.e.keller@intel•com>
Cc: git@vger•kernel.org, Jacob Keller <jacob.keller@gmail•com>
Subject: Re: [PATCH] send-pack: clean up extra_have oid array
Date: Mon, 30 Jun 2025 07:31:23 -0700 [thread overview]
Message-ID: <xmqqfrfh5mis.fsf@gitster.g> (raw)
In-Reply-To: <20250627-jk-fix-leak-send-pack-v1-1-aadcf0ed8a4b@gmail.com> (Jacob Keller's message of "Fri, 27 Jun 2025 15:09:04 -0700")
Jacob Keller <jacob.e.keller@intel•com> writes:
> From: Jacob Keller <jacob.keller@gmail•com>
>
> Commit c8009635785e ("fetch-pack, send-pack: clean up shallow oid
> array", 2024-09-25) cleaned up the shallow oid array in cmd_send_pack,
> but didn't clean up extra_have, which is still leaked at program exit.
> I suspect the particular tests in t5539 don't trigger any additions to
> the extra_have array, which explains why the tests can pass leak free
> despite this gap.
>
> Signed-off-by: Jacob Keller <jacob.keller@gmail•com>
> ---
> I didn't check to see why the t5539 tests don't leak. This leak occured for
> me in a day-to-day run with my local git build that happened to still have
> sanitizers enabled:
The other side may tell you about objects you _cannot_ fetch from
them, but if you have them, these objects can participate in the
common ancestor discovery and reduce the size of the transfer.
If the repository A you are pushing into use an alternate object
store B (i.e., created by "git clone --reference B $URL A" to make A
borrow from another local repository B) for example, the refs in
that alternate B that point at objects not in the repository A are
shown as "extra" objects.
Perhaps we can have these tests push into such a repository?
> diff --git a/builtin/send-pack.c b/builtin/send-pack.c
> index c6e0e9d05186..61486e378cab 100644
> --- a/builtin/send-pack.c
> +++ b/builtin/send-pack.c
> @@ -343,6 +343,7 @@ int cmd_send_pack(int argc,
> free_refs(remote_refs);
> free_refs(local_refs);
> refspec_clear(&rs);
> + oid_array_clear(&extra_have);
> oid_array_clear(&shallow);
> clear_cas_option(&cas);
> return ret;
The change looks obviously correct.
Thanks.
next prev parent reply other threads:[~2025-06-30 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 22:09 [PATCH] send-pack: clean up extra_have oid array Jacob Keller
2025-06-30 14:31 ` Junio C Hamano [this message]
2025-06-30 22:14 ` Jacob Keller
2025-07-01 17:40 ` Junio C Hamano
2025-07-01 20:36 ` Jacob Keller
2025-07-01 21:12 ` Junio C Hamano
2025-07-03 15:40 ` Jeff King
2025-07-03 16:26 ` Jacob Keller
2025-07-03 15:38 ` Jeff King
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=xmqqfrfh5mis.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jacob.e.keller@intel$(echo .)com \
--cc=jacob.keller@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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