Skip to content

Blobwriter: call BlobWriter.Size after BlobWriter.Close - #1705

Closed
aibaars wants to merge 88 commits into
distribution:release/2.4from
aibaars:registry-size-close
Closed

aibaars wants to merge 88 commits into
distribution:release/2.4from
aibaars:registry-size-close

Conversation

@aibaars

@aibaars aibaars commented May 5, 2016

Copy link
Copy Markdown
Contributor

@RichardScothern @aaronlehmann This is a patch for #1698 as alternative to #1703 . In contrast to #1703 this PR attempts to fix the root cause (ie a call of Size on an upload that is not (fully) flushed to the backing storage.

The first commit ensures that Size is not called before Close when committing an upload.
The second commit addresses the case where Cancel is called after closing an upload. The Cancel operation used to fail in that case.

Note that this PR targets the release/2.4 branch instead of master. I am not sure this is the right way of submitting a "hot fix" to a release.

dmcgowan and others added 30 commits February 11, 2016 13:57
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Use client_id as defined in oauth rfc instead of custom client field

Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Allow providing multiple scopes in a single scope string

Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Add post response values
Update password grant type to match oauth spec

Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
The oauth spec defines using a space to separate parts of a scope.
To better comply with future implementations built on oauth use a space to separate the resource scopes.

Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Add specification for using OAuth with the token server
Now that we are using "native" Go vendoring, there is no need to
manipulate GOPATH.

Fixes distribution#1586

Signed-off-by: Aaron Lehmann <[email protected]>
Using $GOPATH/bin/godep or $GOPATH/bin/golint is problematic because
$GOPATH can contain multiple colon-separated paths.

We should just run these like normal binaries. The user should make sure
their $PATH contains $GOPATH/bin, if necessary. This is part of normal
Go setup.

Signed-off-by: Aaron Lehmann <[email protected]>
docs: No need to change GOPATH to use vendored code
…ocation

Makefile: don't look for golint and godep in specific places
Add link to the official list of $GOOS and $GOARCH values and correct
values that were incorrectly listed in the spec examples.

Docker-DCO-1.1-Signed-off-by: Phil Estes <[email protected]>
…e-fix

Correct examples and architecture references in v2.2 spec
Use registry example from golem repository.
Use the golem test runner for the docker integration environment

Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Ensure we log io.Copy errors and bytes copied/total in uploads
…tests

Update docker integration tests to use golem
…on-scopes

Document required IAM permissions for S3 storage driver.
…tdated-container-listings

registry/storage/swift: detect and fix outdated container listings
…n-check

Only check validity of S3 region if not using custom endpoint
The schema2 manifest builder fills in this part of the manifest based on
the descriptor it gets back from BlobIngester's Put method. It passes
the correct media type to Put, but Put ends up replacing this value with
application/octet-stream in its return value.

This commit works around the issue in the manifest builder. Arguably Put
should not be changing the media type in its return value, but this
commit is a targeted fix to keep it very low-risk for possible inclusion
in Docker 1.11.

Fixes distribution#1621 (but maybe we should open a separate issue for the media
type behavior in the distribution client, and the unnecessary stat).

Signed-off-by: Aaron Lehmann <[email protected]>
…-mediatype

Use correct media type for config blob in schema2 manifest
Extend garbage collection documentation.
dmcgowan and others added 18 commits April 29, 2016 09:54
…versions

Use official docker 1.11.1 image to test docker 1.11
…rs-schema1

Preserve author information in schema1 manifests
…-segments

[Swift] wait for DLO segments to show up when Close()ing the writer
convert docs Dockerfiles to use docs/base:oss
This commit refactors base.regulator into the 2.4 interfaces and adds a
filesystem configuration option `maxthreads` to configure the regulator.

By default `maxthreads` is set to 100. This means the FS driver is
limited to 100 concurrent blocking file operations. Any subsequent
operations will block in Go until previous filesystem operations
complete.

This ensures that the registry can never open thousands of simultaneous
threads from os filesystem operations.

Note that `maxthreads` can never be less than 25.

Add test case covering parsable string maxthreads

Signed-off-by: Tony Holdstock-Brown <[email protected]>
Signed-off-by: Tony Holdstock-Brown <[email protected]>
registry: type too many requests error
go1.5 doesn't export http.StatusTooManyRequests while
go1.6 does. Fix this by hardcoding the status code for now.

Signed-off-by: Antonio Murdaca <[email protected]>
registry: do not use http.StatusTooManyRequests
Signed-off-by: Richard Scothern <[email protected]>
Use Alpine Linux as the parent image for the registry.
Entering Seb's comment
Fix the flags

Signed-off-by: Mary Anthony <[email protected]>
Fixing nginx flag issue identified by customer
@RichardScothern

RichardScothern commented May 5, 2016 •

Copy link
Copy Markdown

@aibaars : i'm fine to take this patch into master. We have a missing unit test that isn't catching this and I'd like to add one.

2.4.1 is in release candidate stage. Given this will affects all storage drivers I would feel more comfortable taking the GCS specific fix for 2.4.1 (#1703)

@aibaars
aibaars force-pushed the registry-size-close branch from b327dba to 2e9a93d Compare May 5, 2016 18:07
@aibaars
aibaars force-pushed the registry-size-close branch from 2e9a93d to b87895a Compare May 5, 2016 18:09
@GordonTheTurtle

Copy link
Copy Markdown

Please sign your commits following these rules:
https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "registry-size-close" [email protected]:aibaars/distribution.git somewhere
$ cd somewhere
$ git rebase -i HEAD~88
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Ammending updates the existing PR. You DO NOT need to open a new one.

@aibaars

aibaars commented May 5, 2016

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1706 (merge into master instead of release/2.4)

@aibaars aibaars closed this May 5, 2016
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.