Re: [PATCH 7/7] bundle-uri: fetch a list of bundles
- From
Josh Steadmon <steadmon@google.com>
- Date
- Sep 2, 2022, 23:51 UTC
- Message-ID
- <YxKXHKUe05C3m6ZZ@google.com>
- In-Reply-To
- <7b45c06cc9e0294311d9f00d40eb1fa4f8f146f9.1661181174.git.gitgitgadget@gmail.com>
On 2022.08.22 15:12, Derrick Stolee via GitGitGadget wrote: [snip]
Show 10 quoted lines
> +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.