HTTP2: Update local flow-controller on Channel.read() if needed (#9400)

Motivation:

We should better update the flow-controller on Channel.read() to reduce overhead and memory overhead.

See https://github.com/netty/netty/pull/9390#issuecomment-513008269

Modifications:

Move updateLocalWindowIfNeeded() to doBeginRead()

Result:

Reduce memory overhead
This commit is contained in:
Norman Maurer 2019-08-16 09:27:47 +02:00 committed by GitHub
parent 4db38b4e0c
commit bcad76e2db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -757,6 +757,8 @@ abstract class AbstractHttp2StreamChannel extends DefaultAttributeMap implements
if (!isActive()) {
return;
}
updateLocalWindowIfNeeded();
switch (readStatus) {
case IDLE:
readStatus = ReadStatus.IN_PROGRESS;
@ -833,8 +835,6 @@ abstract class AbstractHttp2StreamChannel extends DefaultAttributeMap implements
readStatus = ReadStatus.IDLE;
}
updateLocalWindowIfNeeded();
allocHandle.readComplete();
pipeline().fireChannelReadComplete();
// Reading data may result in frames being written (e.g. WINDOW_UPDATE, RST, etc..). If the parent