-
Notifications
You must be signed in to change notification settings - Fork 3.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
netty: improve server handling of writes to reset streams #10258
Conversation
A server stream can be reset by the client while server writes are still queued. After the stream is reset, the netty connection will forget the stream object. The `NettyServerHandler` must deal with that situation. `sendResponseHandlers` already had some code to do that. This change standardizes that code and adds it to `sendGrpcFrame`. This fixes a potential bug where a `SendGrpcFrameCommand` with `endOfStream=true` would raise an `AssertionError` if written to a reset stream. (This bug is not currently reachable because `endOfStream=false` for all server `SendGrpcFrameCommand` objects.)
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.
Looks like this slipped through the cracks. I'm sorry it didn't see movement earlier.
I'm definitely a fan of passing around Http2Stream instead of integers that then require lookups.
I made one comment. I don't mind making the change if you are no longer interested.
Looks like #10384 did something related. Although that change still assumes requireHttp2Stream succeeds. This seems even better. |
d861527
to
58a6f83
Compare
58a6f83
to
151efeb
Compare
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.
Thank you much. I wasn't expecting you to be so responsive after we were very-much-so-not-responsive!
@larry-safran, looks like the CI is broken due to a semantic merge conflict with the Multichild cleanup PR. |
A server stream can be reset by the client while server writes are still queued. After the stream is reset, the netty connection will forget the stream object. The
NettyServerHandler
must deal with that situation.sendResponseHandlers
already had some code to do that. This change standardizes that code and adds it tosendGrpcFrame
. This fixes a potential bug where aSendGrpcFrameCommand
withendOfStream=true
would raise anAssertionError
if written to a reset stream. (This bug is not currently reachable becauseendOfStream=false
for all serverSendGrpcFrameCommand
objects.)