-
Notifications
You must be signed in to change notification settings - Fork 236
IPIP-332: Streaming Error Handling on Web Gateways #332
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
Changes from 1 commit
8a175f6
a84fb63
4e73544
8ccb87d
9480caa
a20a665
e7f6b54
3e3b0fe
0fcdd02
4dd1293
c0c6af7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -701,5 +701,9 @@ The usual optimizations involve: | |||||||
|
|
||||||||
| ## Streaming errors | ||||||||
|
|
||||||||
| Gateways MUST force-close HTTP connections if they detect an error while | ||||||||
| streaming a file to avoid that users receive incomplete, yet valid, files. | ||||||||
| To avoid users receiving an incomplete, yet valid, files, the gateway MUST | ||||||||
| close the HTTP stream if an error occurs while streaming a file to the client. | ||||||||
| This can be done via the following mechanisms: | ||||||||
|
|
||||||||
| - Sending a `RST` (reset) frame for HTTP/1.1 | ||||||||
| - Sending a `RST_STREAM` (reset stream) frame for HTTP/2 | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't read the entire spec, but according to BCP 56, HTTP APIs shouldn't go into this level of detail. HTTP is designed in a way that allows building applications without referring to the specific HTTP version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Jorropo Again, haven't read the entire spec, but I are we actually doing server push (which is the only context in which CANCEL_PUSH would be valid)? That feature of HTTP is going to be removed from major browser implementations very soon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't actually red the RFC, I know RST_STREAM on HTTP/2 is what we want, I just CTRL + F RST_STREAM in the HTTP/3 RFC and found this text:
I guess it should be whatever QUIC's frame is to close a stream unexpectedly.
Streaming errors is not a thing HTTP supports, you can setup trailler headers but they aren't supported by browsers. I don't know if we should add this to the gateway spec, because most HTTP server implementations give you as much control as the go std does. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marten-seemann as @Jorropo mentioned, the big issue here is that HTTP doesn't have any error handling for streaming. One of my motivations behind this IPIP regards the new TAR format for the gateway (ipfs/kubo#9029). It is possible that the TAR creation fails while streaming the file to the client due to many reasons. However, if you just stop streaming the TAR, you still get a valid TAR file, but it is incomplete. There's no feedback. Printing a trailer header is useless since browsers are not able to parse them. The only way we found so far to tell the user that something is wrong was by force-closing the HTTP stream. I also have mixed feelings about having this on the spec since it is so specific. In addition, as @Jorropo mentioned it may be worth it having an opt-out of the behaviour through some header. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think this is an important question. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Jorropo please see the updates I've made to the IPIP. |
||||||||
Uh oh!
There was an error while loading. Please reload this page.