GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Upgrading to HTTP/2 draft 14 HTTP/1.x message flow by Scottmitch · Pull Request #2778 · netty/netty

Conversation

@Scottmitch

@Scottmitch Scottmitch commented Aug 17, 2014

Copy link
Copy Markdown
Member

Motivation:

HTTP/2 draft 14 came out a couple of weeks ago and we need to keep up
with the spec.

Modifications:

-Allow informational type messages to be sent up the pipeline immediatley.
-Corrections to HttpObject comparitors to support test cases
-New test cases to support sending headers immediatley
-Bug fixes cleaned up to ensure the message flow is terminated properly

Result:
Netty HTTP/2 to HTTP/1.x translation layer will support the HTTP/2 draft message flow.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Scottmitch Scottmitch mentioned this pull request Aug 17, 2014
Upgrading to HTTP/2 draft 14 framing #2775
Closed
@Scottmitch

Scottmitch commented Aug 17, 2014

Copy link
Copy Markdown
Member Author

@normanmaurer @nmittler FYI. My changed depended upon @nmittler and that is why I branched off his commit. I hope this is OK.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ghost

ghost commented Aug 17, 2014

Copy link
Copy Markdown

Build result for #2778 at 867fdfd1420cf5092d4c1d72754396e34c03a917: Success

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Scottmitch

Scottmitch commented Aug 18, 2014

Copy link
Copy Markdown
Member Author

This essentially extends (and includes the contents of) PR #2775 to update to draft 14 support.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nmittler nmittler mentioned this pull request Aug 18, 2014
HTTP/2 Draft 14 #2715
Closed
@Scottmitch

Scottmitch commented Aug 18, 2014

Copy link
Copy Markdown
Member Author

@nmittler @normanmaurer - PR has now been updated to branch off master (after @nmittler applied his draft 14 related changes) and ready for review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Scottmitch Scottmitch mentioned this pull request Aug 18, 2014
HTTP/2 Priority Tree Event Notification #2779
Closed
nmittler
nmittler reviewed Aug 18, 2014
View reviewed changes
Comment thread codec/src/main/java/io/netty/handler/codec/DefaultTextHeaders.java Outdated

@nmittler nmittler Aug 18, 2014

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just use new TreeSet(String.CASE_INSENSITIVE_ORDER)?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Scottmitch Scottmitch Aug 18, 2014

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. We lose the initial set size optimization, although the initial set size may have been an over-estimate.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ghost

ghost commented Aug 18, 2014

Copy link
Copy Markdown

Build result for #2778 at 685e7dbe9543b42ba14351b9a3fe30947163e08b: Success

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Scottmitch

Scottmitch commented Aug 18, 2014

Copy link
Copy Markdown
Member Author

I just need to push this so I can work on it at home (ignore build results). I still have a few things to get to (tests, client example) to update but here is the comment that spurred the major re-vamp:

This brings up a few interesting points w.r.t to queuing and HTTP/1.x:

  1. I originally based the HTTP/1.x translation interface off of SpdyHttpDecoder and was outputting FullHttpMessage objects. I then changed this to avoid the excessive queuing and memory this may have required and instead sent HttpObject elements directly up the pipeline. I now realize this was a mistake. If HttpObjects are passed up the pipeline there is no way for the ChannelHandler to know which HttpObject is associated with which stream (this is the point of HTTP/2 having a frame structure which includes a stream id).
  2. Having no queuing and directly firing events up the pipeline means that priority can not be accurately represented in HTTP/1.x headers. This is because the priority change events can happen while a stream is open and the headers have already been sent.

So as a result of these reflections I think I need to make the following changes:

  1. I need to bring the queuing back to support outputting only objects of type FullHttpMessage. This may be a bit awkward (or require re-factoring) because I need to support the functionality of HttpContentDecoder to be able to decode DATA.
  2. Bringing the queuing back and hanging on to the FullHttpMessage will allow processing of HTTP/2 priority events to be correctly reflected in HTTP/1.x headers. This is because the FullHttpMessage will not be sent up the pipeline until the end of stream is encountered. Granted queuing up priority events and dispatching them at the end of the message may defeat the purpose a bit, but that is the nature of the HTTP/1.x message flow and the reason HTTP/2 was invented.

@nmittler & @normanmaurer - Does this make sense?

This is a detail but in the case of informational messages I may need to send multiple FullHttpMessage messages up the pipeline for the same stream.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ghost

ghost commented Aug 18, 2014

Copy link
Copy Markdown

Build result for #2778 at 5e05186fbc40b8f9de738b0066994ee438b809a8: Failure

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Scottmitch
Scottmitch reviewed Aug 19, 2014
View reviewed changes
Comment thread codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java

@Scottmitch Scottmitch Aug 19, 2014

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmittler - Here is where the lack of decompression is. I would like to provide hooks into DefaultFrameReader so that before this line: DefaultHttp2FrameReader.java#L382 a ByteToMessageDecoder can be used to decode the data before passing to the observer. I was thinking along the lines of providing an interface to set a ByteToMessageDecoder (which would be done when headers are read/interpreted). Providing this interface allows flexibility to determine which implementation is to be used for decoding (the HTTP/2 layer could also exercise this interface by analyzing headers). I would like to mirror the relationship HttpContentDecoder has with the ChannelPipeline in that by default nothing is done automatically, but if you specify an alternative class you will get decompression. What are your thoughts?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nmittler nmittler Aug 19, 2014

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Scottmitch Agreed, we definitely need to address this, but let's use a separate issue/PR. Sound good? Would you mind opening a bug for this?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Scottmitch Scottmitch Aug 19, 2014

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmittler Yes. Agreed it is better to resolve this independently. Here it is #2793.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nmittler nmittler Aug 19, 2014

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ghost

ghost commented Aug 19, 2014

Copy link
Copy Markdown

Build result for #2778 at 6f177091c72b9c067f3e7561f488a69ee77f15ff: Success

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer
normanmaurer reviewed Aug 19, 2014
View reviewed changes
Comment thread codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java Outdated

@normanmaurer normanmaurer Aug 19, 2014

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indention

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Scottmitch

Scottmitch commented Aug 19, 2014

Copy link
Copy Markdown
Member Author

@normanmaurer - Thanks for the review! I wasn't 100% sure what you wanted me to do with the "indention" comments but I generally cleaned up comments in those areas. Everything else should be taken care of.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nmittler
nmittler reviewed Aug 23, 2014
View reviewed changes
Comment thread codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java Outdated

@nmittler nmittler Aug 23, 2014

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it always be the case that for a server the message is a request and for a client the message is a response? What about push promises? Or can we simply not accept push promises?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Scottmitch Scottmitch Aug 24, 2014

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it always be the case that for a server the message is a request and for a client the message is a response?

Yes. The following section clarifies http://tools.ietf.org/html/draft-ietf-httpbis-http2-14#section-8.1.

What about push promises? Or can we simply not accept push promises?

I believe push promises can be accepted as responses (only server is allowed to do push promise). The corresponding headers will just be queued along with the typical message flow. Is there something specific you had in mind that might cause an issue?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nmittler

nmittler commented Aug 23, 2014

Copy link
Copy Markdown
Member

@Scottmitch done with another round of reviewing. Looks good overall! I'm not sure you have to worry about priority at all here ... we should discuss.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Scottmitch

Scottmitch commented Aug 24, 2014

Copy link
Copy Markdown
Member Author

@nmittler - Thanks for the review. I think my response to one of your comments is a good place to start the discussion. If you want to pull out your response into the general discussion that will work too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Scottmitch

Scottmitch commented Aug 25, 2014

Copy link
Copy Markdown
Member Author

@nmittler - I think by extracting Http2ToHttpImmediateSendDetector.java I was able to consolidate the if checks for FullHttpRequest/FullHttpResponse and also allow for extensiblility. I am not exposing this interface to the static constructor but it can now be easily extended. The naming of the interface may need some work but if you like the concept then I think the last discussion is w.r.t to priority in HTTP translation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ghost

ghost commented Aug 25, 2014

Copy link
Copy Markdown

Build result for #2778 at 6fadc49eeab053f8e43730d24b9640dc17d7b826: Success

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Scottmitch

Scottmitch commented Aug 25, 2014

Copy link
Copy Markdown
Member Author

@nmittler - I also noticed that the build time for my last commit was excessively long for HTTP/2. My unit test class took forever:

Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 200.18 sec - in io.netty.handler.codec.http2.InboundHttp2ToHttpAdapterTest

I have not been able to re-create on my local machine, but I will keep an eye on this when I get to the squash point.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nmittler
nmittler reviewed Aug 25, 2014
View reviewed changes
Comment thread codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ToHttpImmediateSendDetector.java Outdated

@nmittler nmittler Aug 25, 2014

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spelling error crept back in.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Scottmitch Scottmitch Aug 25, 2014

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch...again ;)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Scottmitch Scottmitch mentioned this pull request Aug 25, 2014
HTTP/2 to HTTP translation layer priority information incorrect #2804
Closed
@Scottmitch
HTTP/2 draft 14 HTTP message flow
3161f35
Motivation:

HTTP/2 draft 14 came out a couple of weeks ago and we need to keep up
with the spec.

Modifications:
-Revert back to dispatching FullHttpMessage objects instead of individual HttpObjects
-Corrections to HttpObject comparitors to support test cases
-New test cases to support sending headers immediatley
-Bug fixes cleaned up to ensure the message flow is terminated properly

Result:
Netty HTTP/2 to HTTP/1.x translation layer will support the HTTP/2 draft message flow.
@Scottmitch
Scottmitch force-pushed the http2_14_http_translation branch from a9c63fe to 3161f35 Compare August 25, 2014 17:56
@ghost

ghost commented Aug 25, 2014

Copy link
Copy Markdown

Build result for #2778 at 7df384ebb14a23a89730b3cf9e5c5c922e9cac22: Success

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Scottmitch

Scottmitch commented Aug 25, 2014

Copy link
Copy Markdown
Member Author

@nmittler - Squashed and done with most recent round of comments (besides priority related stuff).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ghost

ghost commented Aug 25, 2014

Copy link
Copy Markdown

Build result for #2778 at 3161f35: Success

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nmittler

nmittler commented Aug 25, 2014

Copy link
Copy Markdown
Member

Cherry-picked into master. Thanks again for the great work @Scottmitch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nmittler nmittler closed this Aug 25, 2014
@Scottmitch

Scottmitch commented Aug 25, 2014

Copy link
Copy Markdown
Member Author

@nmittler - Thanks for your feedback. We will figure out the priority stuff in the near term future. I'll try to take a stab at re-factoring to support the 2 different modes of HTTP translation tonight.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Scottmitch
Scottmitch deleted the http2_14_http_translation branch August 25, 2014 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Scottmitch @nmittler @normanmaurer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.