summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-fetcher-util.h
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2018-05-22 12:21:45 +0100
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-30 16:23:57 +0000
commit938055392fd455027a69398c441b992ae521aa87 (patch)
tree4e09a965cdf4e866d9ee2e283a4d1dec9e051f89 /src/libostree/ostree-fetcher-util.h
parentf31087137ed2ce23b8cd886f2ab37b0b27cbfc61 (diff)
downloadostree-938055392fd455027a69398c441b992ae521aa87.tar.gz
lib/repo-pull: Support retrying requests on transient network errors
Allow network requests to be re-queued if they failed with a transient error, such as a socket timeout. Retry each request up to a limit (default: 5), and only then fail the entire pull and propagate the error to the caller. Add a new ostree_repo_pull_with_options() option, n-network-retries, to control the number of retries (including setting it back to the old default of 0, if the caller wants). Currently, retries are not supported for FetchDeltaSuperData requests, as they are not queued. Once they are queued, adding support for retries should be trivial. A FIXME comment has been left for this. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1594 Approved by: jlebon
Diffstat (limited to 'src/libostree/ostree-fetcher-util.h')
-rw-r--r--src/libostree/ostree-fetcher-util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libostree/ostree-fetcher-util.h b/src/libostree/ostree-fetcher-util.h
index 1e2dabe5..5f62ad45 100644
--- a/src/libostree/ostree-fetcher-util.h
+++ b/src/libostree/ostree-fetcher-util.h
@@ -56,6 +56,7 @@ gboolean _ostree_fetcher_mirrored_request_to_membuf (OstreeFetcher *fetcher,
GPtrArray *mirrorlist,
const char *filename,
OstreeFetcherRequestFlags flags,
+ guint n_network_retries,
GBytes **out_contents,
guint64 max_size,
GCancellable *cancellable,
@@ -64,6 +65,7 @@ gboolean _ostree_fetcher_mirrored_request_to_membuf (OstreeFetcher *fetcher,
gboolean _ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher,
OstreeFetcherURI *uri,
OstreeFetcherRequestFlags flags,
+ guint n_network_retries,
GBytes **out_contents,
guint64 max_size,
GCancellable *cancellable,
@@ -73,6 +75,8 @@ void _ostree_fetcher_journal_failure (const char *remote_name,
const char *url,
const char *msg);
+gboolean _ostree_fetcher_should_retry_request (const GError *error,
+ guint n_retries_remaining);
G_END_DECLS