distribution/registry
Stephen J Day 097fce3bb2 Address server errors received during layer upload
This changeset addresses intermittent internal server errors encountered during
pushes.  The root cause has been isolated to layers that result in identical,
empty filesystems but may have some path declarations (imaginge "./"),
resulting in different tarsums. The main error message reported during these
upload problems was a 500 error, which was not correct.  Further investigation
showed the errors to be rooted in digest verification when finishing uploads.

Inspection of the surrounding code also identified a few issues. PutLayerChunk
was slightly refactered into PutLayerUploadComplete. Helper methods were
avoided to make handler less confusing. This simplification leveraged an
earlier change in the spec that moved non-complete chunk uploads to the PATCH
method. Simple logging was also added in the unknown error case that should
help to avoid mysterious 500 errors in the future.

At the same time, the glaring omission of a proper layer upload cancel method
was rectified. This has been added in this change so it is not missed in the
future.

In the future, we may want to refactor the handler code to be more
straightforward, hopefully letting us avoid these problems in the future.

Added test cases that reproduce these errors and drove these changes include
the following:

1. Push a layer with an empty body results in invalid blob upload.
2. Push a layer with a different tarsum (in this case, empty tar)
3. Deleting a layer upload works.
4. Getting status on a deleted layer upload returns 404.

Common functionality was grouped into shared functions to remove repitition.
The API tests will still require future love.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-01-29 21:26:35 -08:00
..
api_test.go Address server errors received during layer upload 2015-01-29 21:26:35 -08:00
app.go Merge pull request #89 from jlhawn/version_header 2015-01-20 13:42:12 -08:00
app_test.go Update the registry app to use the new storage interfaces 2015-01-16 18:33:28 -08:00
context.go Update the registry app to use the new storage interfaces 2015-01-16 18:33:28 -08:00
helpers.go Move registry package out of repo root 2015-01-06 10:40:22 -08:00
hmac.go Refactor handling of hmac state packing 2015-01-09 14:50:39 -08:00
hmac_test.go Refactor handling of hmac state packing 2015-01-09 14:50:39 -08:00
images.go Update the registry app to use the new storage interfaces 2015-01-16 18:33:28 -08:00
layer.go Update the registry app to use the new storage interfaces 2015-01-16 18:33:28 -08:00
layerupload.go Address server errors received during layer upload 2015-01-29 21:26:35 -08:00
tags.go Update the registry app to use the new storage interfaces 2015-01-16 18:33:28 -08:00
util.go Move registry package out of repo root 2015-01-06 10:40:22 -08:00