-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
Http2 Hang with AbstractHttp2StreamChannel #9636
Comments
After some more debugging, I think I know the change that caused this: #9254 or #9235 One of those changes made Http2MultiplexCodec override |
…tiplexer Motivation: Http2MultiplexCodec extends Http2FrameCodec extends Http2ConnectionHandler. It appears Http2MultiplexCodec overrode the channelWritabilityChanged method, which prevented the flow controller from becoming active. In the case the parent channel becomes unwritable, and then later becomes writable, it needs to indicate that the child channels can still write data. This is slightly confusing, because the child channels may still themselves be unwritable, but should still drain their data to the parent channel. Modification: Still propagate writability changes to the HTTP/2 flow controller Result: Fixes netty#9636
@carl-mastrangelo this sounds about right... Can you ope a PR ? That said I think you should switch to use |
@normanmaurer Yup, I was about to send out PR, but tried writing a unit test to replicate it. It's surprisingly difficult to get the conditions just right to happen, but I do have an exact reproducer internally. I patched in the change (calling super) and can confirm it works. Definitely take your point about using the new thing (and already updated our code), but since Http2MultiplexCodec is still around, I figured I'd at least try to fix it. |
…tiplexer (#9642) Motivation: Http2MultiplexCodec extends Http2FrameCodec extends Http2ConnectionHandler. It appears Http2MultiplexCodec overrode the channelWritabilityChanged method, which prevented the flow controller from becoming active. In the case the parent channel becomes unwritable, and then later becomes writable, it needs to indicate that the child channels can still write data. This is slightly confusing, because the child channels may still themselves be unwritable, but should still drain their data to the parent channel. Modification: Still propagate writability changes to the HTTP/2 flow controller Result: Fixes #9636
…tiplexer (#9642) Motivation: Http2MultiplexCodec extends Http2FrameCodec extends Http2ConnectionHandler. It appears Http2MultiplexCodec overrode the channelWritabilityChanged method, which prevented the flow controller from becoming active. In the case the parent channel becomes unwritable, and then later becomes writable, it needs to indicate that the child channels can still write data. This is slightly confusing, because the child channels may still themselves be unwritable, but should still drain their data to the parent channel. Modification: Still propagate writability changes to the HTTP/2 flow controller Result: Fixes #9636
Netty version
4.1.42-Final
I am working on upgrading to Netty 4.1.42 from 4.1.27, and noticed a bug where HTTP/2 streams will sometimes hang. I am pretty close to the bug, but wanted to get a second set of eyes on it. We (Netflix/Zuul) are using the
Http2MultiplexCodecBuilder
to do Http/1.1 to Http2 connection upgrades. When one of the H2 child channels tries to write a lot of data (>64k) the overall connection hangs. I believe this is due to a dropped writability event. Here is the (approx) sequence of events:ChannelOutboundBuffer.fireChannelWritabilityChanged
Http2MultiplexCodec.channelWritabilityChanged
AbstractHttp2StreamChannel.WRITABLE_VISITOR
applied to it.Http2MultiplexCodecStreamChannel
) . getstrySetWritable()
called. It looks like:setWritable
called.I think the bug is in 6, since this is last event that happens on the child channel. I don't fully understand this code, so I may be mistaken. Also also realize
Http2MultiplexCodecBuilder
is deprecated, but I think the bug is in this shared code. This was not previously an issue in 4.1.27, so I think it is new.cc: @normanmaurer @artgon
The text was updated successfully, but these errors were encountered: