-
Notifications
You must be signed in to change notification settings - Fork 147
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
Error handling for Upload Creation Procedure #2596
Comments
If no Because there seemed to be consensus on server-generated URLs over client-generated tokens for this draft, I think it might be best to keep Idempotency-Key (essentially a client generated token) outside the scope of this protocol. There's already two mechanisms defined with Keeping that in mind, I don't think mentioning In order to benefit, we would need to define a way to do offset retrieving with the |
My understanding is I think |
Exactly, that is the intention here. The value of If the client uploads data in the upload creation and a failure occurs without the client receiving a 104, the client would be able to retry the upload creation in a safer way. The ability to resume gets lost here as the client has to start the upload from the beginning again, but at least the server does not create duplicate resources. Of course, this should only be done if the client know in advance that the server supports idempotent upload creations through an out-of-spec mechanism. I believe that an approach, such as Idempotency-Key is just an improvement without many drawbacks. It would be optional and does not place too strict requirements on implementations. However, the current draft offers no options for the client if the upload creation fails with a 104 response. An idempotent retry could help the client to continue the upload in this case. This would be in line with the goals of resumable upload, where we try to resume an upload whenever possible.
👍 |
I'm a bit confused about how this would work. What is the server supposed to respond to the client here? I might be overthinking this but let's say that the client did a POST to start the upload and included data in the request (i.e. Upload-Complete: ?0). For some reason it did not receive the 104 response. The connection breaks down so the client restarts the upload from offset 0 as it has no way of knowing that the server supports resumable uploads. The same idempotency key are used in both requests. What is the server supposed to respond with for the second request? I can see multiple correct responses here. One being that the server sends the 104 again and then fails the request with a Conflict due to Upload-Offset being wrong. Another that the server just returns an error. Not really sure which one is more correct? |
Idempotency-Key should only be used if the client knows that the server supports resumable uploads and respects Idempotency-Key. Otherwise, this approach could lead to duplicate, unintended upload resources on the server.
The server should respond with a 104 and 201 Created in this case. It should not create a new upload resource, but return the upload URL for the existing upload resource. The client will retransmit the data from offset 0. The server should ignore all bytes that it had already received and only start appending after the upload offset from the server's perspective. For example, if an upload was interrupted after byte 100 in the POST request, the client will send bytes from offset 0 again. But the server "ignores" the first 100 bytes and only appends bytes starting at offset 101 to the upload. Does that clear it up? |
@Acconut Yes makes sense. Thanks for clarifying! |
The current -01 draft for resumable upload says about the Upload Creation Procedure:
This section talks about failure handling when an informational response was received. However, the draft does not describe how a client should/may act if no informational response was received and the client does not have an upload URL to resume.
Previously, we proposed the use of Idempotency-Key for this (#2293), but we didn't agree on including it in the draft.
Can we include some other recommendation or method on how clients should handle failures without an upload URL? For example,
If we do not agree on including a recommendation, should we add a statement that the client must then abort the upload because it failed?
The text was updated successfully, but these errors were encountered: