-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
Correctly handle client side http2 upgrades when Http2FrameCodec is used together with Http2MultiplexHandler (9495) #9501
Conversation
Can one of the admins verify this patch? |
@nizarm thanks I will have a look... that said can you sign our ICLA in the meantime: https://netty.io/s/icla |
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.
Please check my comments... also please add a unit test.
codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ClientUpgradeCodec.java
Show resolved
Hide resolved
codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ClientUpgradeCodec.java
Show resolved
Hide resolved
Thanks, I have already submitted ICLA. |
@nizarm thanks a lot... let me know once you addressed my comments and I will have a look again. |
…used together with Http2MultiplexHandler (netty#9495) Motivation: In the release (4.1.37) we introduced Http2MultiplexHandler as a replacement of Http2MultiplexCodec. This did split the frame parsing from the multiplexing to allow a more flexible way to handle frames and to make the code cleaner. Unfortunally we did miss to special handle this in Http2ClientUpgradeCodec and so did not correctly add Http2MultiplexHandler to the pipeline before calling Http2FrameCodec.onHttpClientUpgrade(...). This did lead to the situation that we did not correctly receive the event on the Http2MultiplexHandler and so did not correctly created the Http2StreamChannel for the upgrade stream. Because of this we ended up with an NPE if a frame was dispatched to the upgrade stream later on. Modifications: - Correctly add Http2MultiplexHandler to the pipeline before calling Http2FrameCodec.onHttpClientUpgrade(...) Result: Fixes netty#9495. Added Unit Test
codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ClientUpgradeCodecTest.java
Outdated
Show resolved
Hide resolved
@netty-bot test this please |
@netty-bot test this please |
@netty-bot test this please |
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.
I'm not so involved in http2 stuff right now, but this looks reasonable to me. for context, here's what we do in finagle: https://github.com/twitter/finagle/blob/7825077f3ee502349c2c9baad8452e480855ed5b/finagle-http2/src/main/scala/com/twitter/finagle/http2/exp/transport/UpgradeRequestHandler.scala#L79-L92
@mosesn thanks for the review and feedback :) |
Thanks @normanmaurer and @mosesn for approving these changes. Since I dont have write access, who will help merge this change? The merging of this change is automatically taken care? |
@nizarm thanks a lot! I just merged it... |
…95) (#9501) Motivation: In the release (4.1.37) we introduced Http2MultiplexHandler as a replacement of Http2MultiplexCodec. This did split the frame parsing from the multiplexing to allow a more flexible way to handle frames and to make the code cleaner. Unfortunally we did miss to special handle this in Http2ClientUpgradeCodec and so did not correctly add Http2MultiplexHandler to the pipeline before calling Http2FrameCodec.onHttpClientUpgrade(...). This did lead to the situation that we did not correctly receive the event on the Http2MultiplexHandler and so did not correctly created the Http2StreamChannel for the upgrade stream. Because of this we ended up with an NPE if a frame was dispatched to the upgrade stream later on. Modifications: - Correctly add Http2MultiplexHandler to the pipeline before calling Http2FrameCodec.onHttpClientUpgrade(...) Result: Fixes #9495.
Correctly handle client side http2 upgrades when Http2FrameCodec is used together with Http2MultiplexHandler (#9495)