Skip to content

don't swallow errors in Swift driver's GetContent() - #1578

Merged
RichardScothern merged 1 commit into
distribution:masterfrom
majewsky:do-not-swallow-error
Mar 31, 2016
Merged

RichardScothern merged 1 commit into
distribution:masterfrom
majewsky:do-not-swallow-error

Conversation

@majewsky

Copy link
Copy Markdown
Contributor

In 326c3a9, which was only intended to be a refactoring commit, the behavior of this block subtly changed so that unknown types of errors would be swallowed instead of propagated.

I noticed this while investigating an error similar to #1539 aka moby/moby#21290. It appears that during GetContent() for a hashstate, the Swift proxy produces an unexpected error. Since this error was silently swallowed, an empty []byte is used to restart the hash, then producing the digest of the empty string instead of the layer's digest.

This PR will not fix the issue, but it should make the actual error more visible by propagating it into `blobWriter#resumeDigest' and 'blobWriter#validateBlob', respectively.

/cc @lebauce

In 326c3a9, which was only intended to
be a refactoring commit, the behavior of this block subtly changed so
that unknown types of errors would be swallowed instead of propagated.

I noticed this while investigating an error similar to #1539 aka
moby/moby#21290. It appears that during GetContent() for a
hashstate, the Swift proxy produces an error. Since this error was
silently swallowed, an empty []byte is used to restart the hash, then
producing the digest of the empty string instead of the layer's digest.

This PR will not fix the issue, but it should make the actual error more
visible by propagating it into `blobWriter#resumeDigest' and
'blobWriter#validateBlob', respectively.

Signed-off-by: Stefan Majewsky <[email protected]>
@codecov-io

Copy link
Copy Markdown

Current coverage is 51.19%

Merging #1578 into master will decrease coverage by -6.81% as of 4c9bed2

@@            master   #1578   diff @@
======================================
  Files          122     122       
  Stmts        10637   10637       
  Branches       838     747    -91
  Methods          0       0       
======================================
- Hit           6170    5446   -724
+ Partial        838     747    -91
- Missed        3629    4444   +815

Review entire Coverage Diff as of 4c9bed2


Uncovered Suggestions

  1. +0.30% via .../driver/s3-aws/s3.go#730...761
  2. +0.29% via .../driver/s3-aws/s3.go#266...295
  3. +0.22% via .../driver/s3-aws/s3.go#882...904
  4. See 7 more...

Powered by Codecov. Updated on successful CI builds.

@RichardScothern

Copy link
Copy Markdown

Sounds reasonable. 👍

@RichardScothern
RichardScothern merged commit 04ff3c0 into distribution:master Mar 31, 2016
@majewsky
majewsky deleted the do-not-swallow-error branch March 31, 2016 08:45
thaJeztah pushed a commit to thaJeztah/distribution that referenced this pull request Apr 22, 2021
don't swallow errors in Swift driver's GetContent()
thaJeztah pushed a commit to thaJeztah/distribution that referenced this pull request Jan 19, 2022
don't swallow errors in Swift driver's GetContent()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants