Skip to content

Clarify writability in Netty4HttpPipeliningHandler #91982

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ private void doWrite(ChannelHandlerContext ctx, Netty4ChunkedHttpResponse readyR
combiner.add((Future<Void>) first);
currentChunkedWrite = new ChunkedWrite(combiner, promise, readyResponse);
if (enqueueWrite(ctx, readyResponse, first)) {
// we were able to write out the first chunk directly, try writing out subsequent chunks until the channel becomes unwritable
// We were able to write out the first chunk directly, try writing out subsequent chunks until the channel becomes unwritable.
// NB "writable" means there's space in the downstream ChannelOutboundBuffer, we aren't trying to saturate the physical channel.
while (ctx.channel().isWritable()) {
if (writeChunk(ctx, combiner, readyResponse.body())) {
finishChunkedWrite();
Expand Down Expand Up @@ -280,6 +281,7 @@ private boolean doFlush(ChannelHandlerContext ctx) throws IOException {
return false;
}
while (channel.isWritable()) {
// NB "writable" means there's space in the downstream ChannelOutboundBuffer, we aren't trying to saturate the physical channel.
WriteOperation currentWrite = queuedWrites.poll();
if (currentWrite == null) {
doWriteQueued(ctx);
Expand Down