Skip to content

Commit

Permalink
ostree-fetcher-curl: retry requests that fail except NOT_FOUND
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jmarrero committed Apr 6, 2023
1 parent c927142 commit f548121
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libostree/ostree-fetcher-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f548121

Please sign in to comment.