You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/10/11 08:09:20 UTC

[GitHub] [dubbo] asa3311 commented on a diff in pull request #10672: triple反压增加流控

asa3311 commented on code in PR #10672:
URL: https://github.com/apache/dubbo/pull/10672#discussion_r991978057


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/BiStreamServerCallListener.java:
##########
@@ -41,13 +49,27 @@ public void onReturn(Object value) {
 
     @Override
     public void onMessage(Object message) {
-        if (message instanceof Object[]) {
-            message = ((Object[]) message)[0];
+        if (((TripleFlowControlFrame) message).getInstance() instanceof Object[]) {

Review Comment:
   in my test,it must be TripleFlowControlFrame,but I added type judgment in the latest version。



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/UnaryServerCallListener.java:
##########
@@ -37,11 +49,15 @@ public void onReturn(Object value) {
 
     @Override
     public void onMessage(Object message) {
-        if (message instanceof Object[]) {
-            invocation.setArguments((Object[]) message);
+        if (((TripleFlowControlFrame) message).getInstance() instanceof Object[]) {

Review Comment:
   in my test,it must be TripleFlowControlFrame,but I added type judgment in the latest version。



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleHttp2FrameServerHandler.java:
##########
@@ -112,15 +112,18 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E
     public void onDataRead(ChannelHandlerContext ctx, Http2DataFrame msg) throws Exception {
         final TripleServerStream tripleServerStream = ctx.channel().attr(SERVER_STREAM_KEY)
             .get();
-        tripleServerStream.transportObserver.onData(msg.content(), msg.isEndStream());
+        tripleServerStream.transportObserver.onData(msg, msg.isEndStream());
     }
 
     public void onHeadersRead(ChannelHandlerContext ctx, Http2HeadersFrame msg) throws Exception {
         TripleServerStream tripleServerStream = new TripleServerStream(ctx.channel(),
             frameworkModel, executor,
             pathResolver, acceptEncoding, filters);
         ctx.channel().attr(SERVER_STREAM_KEY).set(tripleServerStream);
-        tripleServerStream.transportObserver.onHeader(msg.headers(), msg.isEndStream());
+
+        //transmit connection to triple invoke to flowcontrol
+        Http2Connection connection = (Http2Connection)ctx.channel().attr(AttributeKey.valueOf("tri-connection")).get();

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org