Subject: Re: [PATCH 7/7] bundle-uri: fetch a list of bundles

From: Josh Steadmon <[email-masked]>
Date: Fri, 2 Sep 2022 16:51:56 -0700

On 2022.08.22 15:12, Derrick Stolee via GitGitGadget wrote:
[snip]
> +static int download_bundle_to_file(struct remote_bundle_info *bundle, void *data)
> +{
> +	struct bundle_list_context *ctx = data;
> +
> +	if (ctx->mode == BUNDLE_MODE_ANY && ctx->count)
> +		return 0;
> +
> +	ctx->count++;
> +	return fetch_bundle_uri_internal(ctx->r, bundle, ctx->depth + 1, ctx->list);
> +}

We should check whether fetch_bundle_uri_internal() actually succeeds
before we increment ctx->count here. Otherwise, if we're in
BUNDLE_MODE_ANY and the client gets unlucky that one of the servers
hosting a bundle file is offline, it won't retry any of the other
servers.