-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Triple flowcontrol #10811
Triple flowcontrol #10811
Conversation
Codecov Report
@@ Coverage Diff @@
## 3.2 #10811 +/- ##
============================================
- Coverage 64.68% 64.66% -0.03%
+ Complexity 390 389 -1
============================================
Files 1342 1345 +3
Lines 57276 57811 +535
Branches 8446 8512 +66
============================================
+ Hits 37047 37381 +334
- Misses 16244 16397 +153
- Partials 3985 4033 +48
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Assertions.assertTrue(listener.started); | ||
stream.request(2); | ||
byte[] data = new byte[]{0, 0, 0, 0, 1, 1}; | ||
final ByteBuf buf = Unpooled.wrappedBuffer(data); | ||
transportListener.onData(buf, false); | ||
Http2DataFrame fame = new DefaultHttp2DataFrame(buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't understand
@@ -173,12 +173,14 @@ public final void onComplete() { | |||
} | |||
|
|||
@Override | |||
public final void onMessage(byte[] message) { | |||
public final void onMessage(TripleFlowControlFrame data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlowControlFrame
should not be known by Call
class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to object
|
||
private Object instance; | ||
|
||
public TripleFlowControlFrame(Http2Connection http2Connection, int windowSizeIncrement, Http2WindowUpdateFrame http2WindowUpdateFrame, byte[] message){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decouple message
bytes , instance and flow control related field maybe better
/** | ||
* This design is learning from {@see io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController} which is in Netty. | ||
*/ | ||
@UnstableApi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TLDR, why copy instead just use netty directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because netty directly will consumeBytes to when received data, i use new function consumeTriBytes to instead it. so it can consumeBytes when after dubbo invoke.
@@ -46,7 +47,7 @@ public AbstractServerCallListener(RpcInvocation invocation, Invoker<?> invoker, | |||
this.responseObserver = responseObserver; | |||
} | |||
|
|||
public void invoke() { | |||
public void invoke(TripleFlowControlFrame tripleFlowControlBean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call
may only need a common data
class as param, no need to know flow control
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to object
@@ -59,6 +60,12 @@ public void invoke() { | |||
final long stInMillis = System.currentTimeMillis(); | |||
try { | |||
final Result response = invoker.invoke(invocation); | |||
//unary and serverstream add flowcontrol update windowsize | |||
if(null != tripleFlowControlBean && null != tripleFlowControlBean.getHttp2Connection() && tripleFlowControlBean.getWindowSizeIncrement() > 0 && null != tripleFlowControlBean.getHttp2WindowUpdateFrame()){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may lead to queueing on IO when inovke
is slow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is removed
public BiStreamServerCallListener(RpcInvocation invocation, Invoker<?> invoker, | ||
ServerCallToObserverAdapter<Object> responseObserver) { | ||
super(invocation, invoker, responseObserver); | ||
invocation.setArguments(new Object[]{responseObserver}); | ||
invoke(); | ||
invoke(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙅 to pass null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
link #11011 |
conflic too much,link #11011 |
What is the purpose of the change
Related with #10748
sample:
apache/dubbo-samples#531
Brief changelog
Verifying this change
Checklist