Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should an upload be resumed? #353

Closed
lgalfaso opened this issue Sep 21, 2022 · 2 comments · Fixed by #366
Closed

How should an upload be resumed? #353

lgalfaso opened this issue Sep 21, 2022 · 2 comments · Fixed by #366

Comments

@lgalfaso
Copy link

The spec talks about Resumable Push but it is not clear how this should be performed. Docker API v2 spec defines that when sending a chunk in a session, if the range does not match, then the response should be of the following form

416 Requested Range Not Satisfiable
Location: /v2/<name>/blobs/uploads/<uuid>
Range: 0-<last valid range>
Content-Length: 0
Docker-Upload-UUID: <uuid>

the key here being that there is Range: 0-<last valid range> that would tell the client about the last position written.

@sudo-bmitch
Copy link
Contributor

Under the Push definition, there's a PATCH description that includes the range. I don't think that's valid to resume a partial PUT, you'd need to do it from the first request.

@lgalfaso
Copy link
Author

The Resumable Push section reads (emphasis are mine)

Company X's build servers lose connectivity to a distribution endpoint before completing an artifact layer transfer. After connectivity returns, the build server attempts to re-upload the artifact. The registry notifies the build server that the upload has already been partially attempted. The build server responds by only sending the remaining data to complete the artifact file.

Following the same naming conventions, if the build server wants to know what is the last byte that was uploaded in order to resume the upload from this point. How it is suppose to do so? Returning Range: 0-<last valid range> is a way to inform this specific information.

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 a pull request may close this issue.

2 participants