Skip to content
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

fix too many flush #13244

Open
wants to merge 3 commits into
base: 4.1
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,9 @@ void doBeginRead() {
}
// We need to double check that there is nothing left to flush such as a
// window update frame.
flush();
if (isActive()) {
flush();
Copy link
Author

Choose a reason for hiding this comment

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

if stream state is CLOSE, it should not need to be flush, right?

if (!Http2Stream.State.CLOSED.equals(stream.state())) {
    flush();
}

Copy link
Member

Choose a reason for hiding this comment

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

well I think it might still need to do to ensure connection window updates are flushed ?

Copy link
Member

Choose a reason for hiding this comment

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

correct, spec allows writing window_update frame after endStream=true

Copy link
Member

Choose a reason for hiding this comment

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

@normanmaurer for ST this change won't make any difference because we manage flushes externally. But I can imagine that there is a risk to break users who rely on the current behavior (flush before closing the stream). Maybe it's worth adding an opt-in property to control this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this checking of stream state is sufficient. The flow controller does at least profess to free any remaining bytes on stream closure and thus ignores any more stream flow window updates here.

}
break;
}
final RecvByteBufAllocator.Handle allocHandle = recvBufAllocHandle();
Expand Down