From: Toon Claes <toon@iotcl.com>
To: Justin Tobler <jltobler@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] bundle-uri: do not abort on invalid packet line
Date: Wed, 17 Sep 2025 10:40:59 +0200 [thread overview]
Message-ID: <878qido4is.fsf@iotcl.com> (raw)
In-Reply-To: <yqyn5w6oq47lhrcbuziip5tajzrpylirswr5kyfyu35n3k7vgj@jn4rc7cwqwow>
Justin Tobler <jltobler@gmail.com> writes:
> Is there any reason that the server should be expected to invalid data
> to the client?
You mean "should be sending"? Well, at $DAYJOB we've had some
unintentional misconfiguration that led to a similar failure[1]. I
wasn't able to reproduce the exact same failure in test, because it
requires to pass different configuration to the `GET info/refs` and
`POST upload-pack` handlers, but the effect is the same.
[1]: https://gitlab.com/gitlab-org/git/-/issues/564
> If the server is misconfigured, I wonder if it should
> instead handle this issue by not sending the invalid bundle-uri in the
> first place and printing a warning message on the server-side. From
> client perspective, if it's a server-side issue there may not be much
> they can do about the error and it could cause some confusion.
I can include a server-side fix in this series as well, but that doesn't
hold back there might be servers out there in the field that don't have
that fix and still serve invalid data. I think ideally we should fix it
on both sides.
>> Signed-off-by: Toon Claes <toon@iotcl.com>
>> ---
>> connect.c | 4 ++--
>> t/t5558-clone-bundle-uri.sh | 25 +++++++++++++++++++++++++
>> 2 files changed, 27 insertions(+), 2 deletions(-)
>>
>> diff --git a/connect.c b/connect.c
>> index 8352b71faf..d2e2bd8cce 100644
>> --- a/connect.c
>> +++ b/connect.c
>> @@ -536,8 +536,8 @@ int get_remote_bundle_uri(int fd_out, struct packet_reader *reader,
>> if (!bundle_uri_parse_line(bundles, line))
>> continue;
>>
>> - return error(_("error on bundle-uri response line %d: %s"),
>> - line_nr, line);
>> + warning(_("ignore invalid bundle-uri response line %d: %s"),
>> + line_nr, line);
>
> If I'm understanding correctly, an error here indicates some sort of
> issue between the client and remote Git server while figuring out the
> bundle-uri capability.
> I think it is reasonable for the client to always
> expect the server to communicate in a way it understands and IMO should
> probably be handled by fixing the server-side instead.
Ideally yes, but broken servers exist now. Having clients deal with it
properly is anyway advised in my opinion.
--
Cheers,
Toon
next prev parent reply other threads:[~2025-09-17 8:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 16:46 [PATCH 0/2] Make git-clone(1) more resilient when using bundle-URI Toon Claes
2025-09-12 16:46 ` [PATCH 1/2] bundle-uri: ignore bundles without uri Toon Claes
2025-09-12 17:11 ` Justin Tobler
2025-09-12 17:18 ` Junio C Hamano
2025-09-16 15:25 ` Toon Claes
2025-09-16 16:59 ` Junio C Hamano
2025-09-12 16:46 ` [PATCH 2/2] bundle-uri: do not abort on invalid packet line Toon Claes
2025-09-12 17:37 ` Justin Tobler
2025-09-17 8:40 ` Toon Claes [this message]
2025-09-17 14:30 ` Justin Tobler
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=878qido4is.fsf@iotcl.com \
--to=toon@iotcl.com \
--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 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 NNTP newsgroup(s).