Skip to content

Allow GOAWAY to be sent from handlers after the Http2MultiplexCodec#6480

Closed
exell-christopher wants to merge 1 commit into
netty:4.1from
exell-christopher:allow_go_away_from_stream_context
Closed

Allow GOAWAY to be sent from handlers after the Http2MultiplexCodec#6480
exell-christopher wants to merge 1 commit into
netty:4.1from
exell-christopher:allow_go_away_from_stream_context

Conversation

@exell-christopher
Copy link
Copy Markdown

@exell-christopher exell-christopher commented Mar 1, 2017

Motivation:
When a server is load-shedding or preparing to shut-down gracefully, it would be nice to be able to issue a GOAWAY so that existing requests can finish, but new requests are turned away. The Http2FrameCodec seems to have all the correct handling for this, but the Http2MultiplexCodec does not allow for anything other than an Http2StreamFrame to be written. As far as I can tell server developers have no way to send a GOAWAY without extending the Http2MultiplexCodec itself which doesn't seem ideal.

Modification:
Update the write() functionality of the the Http2MultiplexCodec to allow Http2GoAwayFrame and Http2StreamFrame to be written.

Added one test, but feel like there may need to be more, just not sure at which level they need to be added.

My read through of the spec indicates that this shouldn't violate any rules.

@normanmaurer
Copy link
Copy Markdown
Member

LGTM... @Scottmitch @nmittler PTAL

@normanmaurer
Copy link
Copy Markdown
Member

Also maybe @buchgr

Copy link
Copy Markdown
Member

@Scottmitch Scottmitch left a comment

Choose a reason for hiding this comment

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

few comments then lgtm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we need to call goAwayFrame.release() when we are done with goAwayFrame

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks like we missed a call to ReferenceCountUtil.release(frame); previously ... can you add this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Will do.

…o that app developers can shed load by issuing GOAWAY
@exell-christopher exell-christopher force-pushed the allow_go_away_from_stream_context branch from e9f5b80 to ca20d54 Compare March 2, 2017 01:53
@exell-christopher
Copy link
Copy Markdown
Author

Changes Committed.

@Scottmitch Scottmitch self-assigned this Mar 2, 2017
@Scottmitch Scottmitch added this to the 4.1.9.Final milestone Mar 2, 2017
@Scottmitch
Copy link
Copy Markdown
Member

4.1 (52aecab)

Thanks @exell-christopher !

@Scottmitch Scottmitch closed this Mar 2, 2017
@ejona86
Copy link
Copy Markdown
Member

ejona86 commented Mar 11, 2017

FYI: I think this was previously possible by writing the GOAWAY to the Channel.parent().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants