From 435ae57a9aa82c99f94926d8f16c7b51a1f536f7 Mon Sep 17 00:00:00 2001 From: Joseph Marrero Date: Mon, 3 Apr 2023 19:04:57 -0400 Subject: [PATCH] ostree-fetcher-curl: retry requests that fail except NOT_FOUND This will return G_IO_ERROR_TIMED_OUT with any call that fails except on cases were the call returns a NOT_FOUND error. This will trigger a retry. --- src/libostree/ostree-fetcher-curl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c index 522eacfb23..c487f18d85 100644 --- a/src/libostree/ostree-fetcher-curl.c +++ b/src/libostree/ostree-fetcher-curl.c @@ -329,7 +329,11 @@ check_multi_info (OstreeFetcher *fetcher) } else { - g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, + /* When it is not a file, we want to retry the request. + * We accomplish that by using G_IO_ERROR_TIMED_OUT. + */ + int g_io_error_code = is_file ? G_IO_ERROR_FAILED : G_IO_ERROR_TIMED_OUT + g_task_return_new_error (task, G_IO_ERROR, g_io_error_code, "While fetching %s: [%u] %s", eff_url, curlres, curl_easy_strerror (curlres)); _ostree_fetcher_journal_failure (req->fetcher->remote_name,