One reason is, 5 is an arbitrary number so ought to be configurable.
The real reason though, is I wanted to make the man page explain when
forward retry can override annex.retry, and having a config made the
man page easier to write.
- transfer left off, and so it would make sense to keep retrying forever,
- other remotes restart each transfer from the beginning, and so even if
- forward progress is being made, it's not real progress. So, retry a
- - maximum of 5 times
+ - maximum of 5 times by default.
-}
forwardRetry :: RetryDecider
-forwardRetry = \numretries old new -> pure $ and
- [ fromMaybe 0 (bytesComplete old) < fromMaybe 0 (bytesComplete new)
- , numretries <= 5
- ]
+forwardRetry numretries old new
+ | fromMaybe 0 (bytesComplete old) < fromMaybe 0 (bytesComplete new) =
+ (numretries <=) <$> maybe globalretrycfg pure remoteretrycfg
+ | otherwise = return False
+ where
+ globalretrycfg = fromMaybe 5 . annexForwardRetry
+ <$> Annex.getGitConfig
+ remoteretrycfg = remoteAnnexRetry =<<
+ (Remote.gitconfig <$> transferRemote new)
{- Retries a number of times with growing delays in between when enabled
- by git configuration. -}
* Limit retrying of failed transfers when forward progress is being made
to 5, to avoid some unusual edge cases where too much retrying could
result in far more data transfer than makes sense.
+ * Exposed annex.forward-retry git config, to configure the forward retry
+ behavior that git-annex has had for a long time.
* Retry transfers to exporttree=yes remotes same as for other remotes.
* import: Retry downloads that fail, same as is done for downloads generally.
, annexAddUnlocked :: Configurable (Maybe String)
, annexSecureHashesOnly :: Bool
, annexRetry :: Maybe Integer
+ , annexForwardRetry :: Maybe Integer
, annexRetryDelay :: Maybe Seconds
, annexAllowedUrlSchemes :: S.Set Scheme
, annexAllowedIPAddresses :: String
fmap Just $ getmaybe (annexConfig "addunlocked")
, annexSecureHashesOnly = getbool (annexConfig "securehashesonly") False
, annexRetry = getmayberead (annexConfig "retry")
+ , annexForwardRetry = getmayberead (annexConfig "forward-retry")
, annexRetryDelay = Seconds
<$> getmayberead (annexConfig "retrydelay")
, annexAllowedUrlSchemes = S.fromList $ map mkScheme $
, remoteAnnexSpeculatePresent :: Bool
, remoteAnnexBare :: Maybe Bool
, remoteAnnexRetry :: Maybe Integer
+ , remoteAnnexForwardRetry :: Maybe Integer
, remoteAnnexRetryDelay :: Maybe Seconds
, remoteAnnexAllowUnverifiedDownloads :: Bool
, remoteAnnexConfigUUID :: Maybe UUID
, remoteAnnexSpeculatePresent = getbool "speculate-present" False
, remoteAnnexBare = getmaybebool "bare"
, remoteAnnexRetry = getmayberead "retry"
+ , remoteAnnexForwardRetry = getmayberead "forward-retry"
, remoteAnnexRetryDelay = Seconds
<$> getmayberead "retrydelay"
, remoteAnnexAllowUnverifiedDownloads = (== Just "ACKTHPPT") $
* `remote.<name>.annex-retry`, `annex.retry`
- Configure retries of failed transfers on a per-remote and general
- basis, respectively. The value is the number of retries that can be
- made of the same transfer. (default 0)
+ Number of times a transfer that fails can be retried. (default 0)
+
+* `remote.<name>.annex-forward-retry`, `annex.forward-retry`
+
+ If a transfer made some forward progress before failing,
+ this allows it to be retried even when `annex.retry` does not.
+ The value is the maximum number of times to do that. (default 5)
+
+ When both `annex.retry` and this are set, the maximum number of
+ retries is the larger of the two.
* `remote.<name>.annex-retry-delay`, `annex.retry-delay`