store: retry once on hashsum mismatches in a Download() #3159

Merged
merged 5 commits into from Apr 19, 2017

Conversation

Projects
None yet
3 participants
Collaborator

mvo5 commented Apr 10, 2017

Right now we do not retry on hashsum mismatches. However we probably want to retry once in this case. Alternatively we could extend the hashsum error so that it contains a flag if it did an internal retry already with partial-content and only retry in this case.

We are seening errors from the CDN currently (https://forum.snapcraft.io/t/hashsum-failures-during-tests/198) and we suspect that the CDN is sending wrong partial content data.

mvo5 added some commits Apr 10, 2017

add download test with EOF in the middle
This adds a test that checks if the download function handles
the EOF case in the middle of the download correctly.

Yes, I think it makes sense, thanks for the change. Just one minor nitpick about error message.

store/store.go
- // Note that we will retry this way only once.
- if _, ok := err.(HashError); ok && resume > 0 {
+ // If hashsum is incorrect retry once
+ if _, ok := err.(HashError); ok {
logger.Debugf("Error on resumed download: %v", err.Error())
@stolowski

stolowski Apr 13, 2017

Contributor

I think this error message needs correction now after this change (it's true as long as resume>0 only afaict).

Thanks!

zyga approved these changes Apr 19, 2017

+1

@zyga zyga merged commit 041b03b into snapcore:master Apr 19, 2017

6 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment