Conversation
When the server runs in strict thread mode with the event-loop threading model, a stream bound to the connection event-loop is exclusively written from that thread, therefore the outbound message queue is not needed: messages can be relayed to the connection directly, like HTTP/1 does. The outbound queue of DefaultHttp2Stream becomes an OutboundWriteQueue with two implementations: QueuedWriteQueue, the existing OutboundMessageQueue, and DirectWriteQueue, which writes without queueing and rejects writes performed from another thread. Frames the stream window cannot accommodate are held by the Netty flow controller instead, which also fails their promises when the stream is reset. HttpServerResponseImpl checks the calling thread before it mutates any state, so that a rejected write leaves the response usable. Signed-off-by: doxlik <doxlikx@gmail.com>
Contributor
Author
|
@vietj Hi. Please have a look once you have time. |
Member
|
actually I am not sure to keep this feature in vertx because I think it will raise too many issues on the long term to support it. |
Member
|
also if I would merge that, before I would like to perform some work on the HTTP stream API to make more efficient ByteBuf <-> Object conversion for gRPC which means in practice rewriting some internals. So allow me for now to park this PR until further notice. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When the server runs in strict thread mode with the event-loop threading model, a stream bound to the connection event-loop is exclusively written from that thread, therefore the outbound message queue is not needed: messages can be relayed to the connection directly, like HTTP/1 does.
The outbound queue of DefaultHttp2Stream becomes an OutboundWriteQueue with two implementations: QueuedWriteQueue, the existing OutboundMessageQueue, and DirectWriteQueue, which writes without queueing and rejects writes performed from another thread. Frames the stream window cannot accommodate are held by the Netty flow controller instead, which also fails their promises when the stream is reset.
HttpServerResponseImpl checks the calling thread before it mutates any state, so that a rejected write leaves the response usable.
Measured on a hello world server:
-c8 -m128-c16 -m128Resolves #6369