moby/distribution/xfer
Cory Snider c322779dce distribution/xfer: make off-by-one error a feature
maxDownloadAttempts maps to the daemon configuration flag

    --max-download-attempts int
      Set the max download attempts for each pull (default 5)

and the daemon configuration machinery interprets a value of 0 as "apply
the default value" and not a valid user value (config validation/
normalization bugs notwithstanding). The intention is clearly that this
configuration value should be an upper limit on the number of times the
daemon should try to download a particular layer before giving up. So it
is surprising to have the configuration value interpreted as a _retry_
limit. The daemon will make up to N+1 attempts to download a layer! This
also means users cannot disable retries even if they wanted to.

As this is a longstanding bug, not a recent regression, it would not be
appropriate to backport the fix (97921915a8)
in a patch release. Update the test to assert on the buggy behaviour so
it passes again.

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 938ed9a1ed)
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-10-20 19:01:17 -04:00
..
download.go Adding ability to change max download attempts 2019-09-19 13:51:40 +02:00
download_test.go distribution/xfer: make off-by-one error a feature 2023-10-20 19:01:17 -04:00
transfer.go distribution: retry downloading schema config on retryable error 2022-03-05 20:29:10 +00:00
transfer_test.go TestTransfer*: don't call t.Fatal from a goroutine 2019-09-18 12:57:37 +02:00
upload.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
upload_test.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00