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/24 04:50:12 UTC

[GitHub] [dubbo] asa3311 opened a new pull request, #10811: Triple flowcontrol

asa3311 opened a new pull request, #10811:
URL: https://github.com/apache/dubbo/pull/10811

   ## What is the purpose of the change
   Related with #10748
   
   
   
   ## Brief changelog
   
   
   ## Verifying this change
   
   
   <!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
   
   ## Checklist
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
   - [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
   - [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
   - [ ] GitHub Actions works fine on your own branch.
   - [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
   


-- 
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


[GitHub] [dubbo] guohao commented on a diff in pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
guohao commented on code in PR #10811:
URL: https://github.com/apache/dubbo/pull/10811#discussion_r1028781540


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleFlowControlFrame.java:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dubbo.rpc.protocol.tri;
+import io.netty.handler.codec.http2.Http2Connection;
+import io.netty.handler.codec.http2.Http2WindowUpdateFrame;
+
+public class TripleFlowControlFrame {
+
+    private Http2Connection http2Connection;
+
+    private int windowSizeIncrement;
+
+    private Http2WindowUpdateFrame http2WindowUpdateFrame;
+
+    private byte[] message;
+
+    private Object instance;
+
+    public TripleFlowControlFrame(Http2Connection http2Connection, int windowSizeIncrement, Http2WindowUpdateFrame http2WindowUpdateFrame, byte[] message){

Review Comment:
   Decouple `message` bytes , instance and flow control related field maybe better



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCall.java:
##########
@@ -173,12 +173,14 @@ public final void onComplete() {
     }
 
     @Override
-    public final void onMessage(byte[] message) {
+    public final void onMessage(TripleFlowControlFrame data) {

Review Comment:
   `FlowControlFrame` should not be known by `Call` class



##########
dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStreamTest.java:
##########
@@ -109,12 +110,13 @@ public void progress() {
         headers.set(TripleHeaderEnum.STATUS_KEY.getHeader(), TriRpcStatus.OK.code.code + "");
         headers.set(TripleHeaderEnum.CONTENT_TYPE_KEY.getHeader(),
             TripleHeaderEnum.CONTENT_PROTO.getHeader());
-        transportListener.onHeader(headers, false);
+        transportListener.onHeader(headers, false,null);
         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);

Review Comment:
   typo



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java:
##########
@@ -46,7 +47,7 @@ public AbstractServerCallListener(RpcInvocation invocation, Invoker<?> invoker,
         this.responseObserver = responseObserver;
     }
 
-    public void invoke() {
+    public void invoke(TripleFlowControlFrame tripleFlowControlBean) {

Review Comment:
   `call` may only need a common `data` class as param, no need to know flow control



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/BiStreamServerCallListener.java:
##########
@@ -16,22 +16,28 @@
  */
 
 package org.apache.dubbo.rpc.protocol.tri.call;
-
+import io.netty.handler.codec.http2.Http2WindowUpdateFrame;
+import io.netty.handler.codec.http2.Http2Connection;
+import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.LoggerFactory;
 import org.apache.dubbo.common.stream.StreamObserver;
 import org.apache.dubbo.rpc.Invoker;
 import org.apache.dubbo.rpc.RpcInvocation;
 import org.apache.dubbo.rpc.TriRpcStatus;
 import org.apache.dubbo.rpc.protocol.tri.observer.ServerCallToObserverAdapter;
-
+import org.apache.dubbo.rpc.protocol.tri.TriHttp2LocalFlowController;
+import org.apache.dubbo.rpc.protocol.tri.TripleFlowControlFrame;
 public class BiStreamServerCallListener extends AbstractServerCallListener {
 
     private StreamObserver<Object> requestObserver;
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(BiStreamServerCallListener.class);
+
     public BiStreamServerCallListener(RpcInvocation invocation, Invoker<?> invoker,
         ServerCallToObserverAdapter<Object> responseObserver) {
         super(invocation, invoker, responseObserver);
         invocation.setArguments(new Object[]{responseObserver});
-        invoke();
+        invoke(null);

Review Comment:
   🙅 to pass `null`



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriHttp2RemoteFlowController.java:
##########
@@ -0,0 +1,794 @@
+/*
+ * Copyright 2014 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.dubbo.rpc.protocol.tri;
+
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.util.internal.UnstableApi;
+import io.netty.util.internal.logging.InternalLogger;
+import io.netty.util.internal.logging.InternalLoggerFactory;
+import java.util.ArrayDeque;
+import java.util.Deque;
+import io.netty.handler.codec.http2.Http2Error;
+import static io.netty.handler.codec.http2.Http2Error.FLOW_CONTROL_ERROR;
+import static io.netty.handler.codec.http2.Http2Error.INTERNAL_ERROR;
+import static io.netty.handler.codec.http2.Http2Error.STREAM_CLOSED;
+import static io.netty.handler.codec.http2.Http2CodecUtil.DEFAULT_WINDOW_SIZE;
+import static io.netty.handler.codec.http2.Http2CodecUtil.MIN_WEIGHT;
+import static io.netty.handler.codec.http2.Http2CodecUtil.MAX_WEIGHT;
+import io.netty.handler.codec.http2.WeightedFairQueueByteDistributor;
+import io.netty.handler.codec.http2.StreamByteDistributor;
+import io.netty.handler.codec.http2.Http2StreamVisitor;
+import io.netty.handler.codec.http2.Http2Exception;
+import io.netty.handler.codec.http2.Http2ConnectionAdapter;
+import io.netty.handler.codec.http2.Http2Connection;
+import io.netty.handler.codec.http2.Http2RemoteFlowController;
+import io.netty.handler.codec.http2.Http2Stream;
+import org.apache.dubbo.common.config.Configuration;
+import org.apache.dubbo.common.config.ConfigurationUtils;
+import org.apache.dubbo.rpc.model.ApplicationModel;
+import static io.netty.handler.codec.http2.Http2Exception.streamError;
+import static io.netty.handler.codec.http2.Http2Stream.State.HALF_CLOSED_LOCAL;
+import static io.netty.util.internal.ObjectUtil.checkNotNull;
+import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
+import static java.lang.Math.max;
+import static java.lang.Math.min;
+import static org.apache.dubbo.rpc.Constants.H2_SETTINGS_INITIAL_WINDOW_SIZE_KEY;
+
+/**
+ * This design is learning from {@see io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController} which is in Netty.
+ */
+@UnstableApi

Review Comment:
   TLDR, why copy instead just use netty directly?



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java:
##########
@@ -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()){

Review Comment:
   This may lead to queueing on IO when `inovke` is slow



-- 
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


[GitHub] [dubbo] asa3311 commented on pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
asa3311 commented on PR #10811:
URL: https://github.com/apache/dubbo/pull/10811#issuecomment-1326071085

   link #11011 


-- 
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


[GitHub] [dubbo] asa3311 commented on a diff in pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
asa3311 commented on code in PR #10811:
URL: https://github.com/apache/dubbo/pull/10811#discussion_r1031148912


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java:
##########
@@ -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()){

Review Comment:
   is removed 



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java:
##########
@@ -46,7 +47,7 @@ public AbstractServerCallListener(RpcInvocation invocation, Invoker<?> invoker,
         this.responseObserver = responseObserver;
     }
 
-    public void invoke() {
+    public void invoke(TripleFlowControlFrame tripleFlowControlBean) {

Review Comment:
   change to object



-- 
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


[GitHub] [dubbo] asa3311 closed pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
asa3311 closed pull request #10811: Triple flowcontrol
URL: https://github.com/apache/dubbo/pull/10811


-- 
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


[GitHub] [dubbo] codecov-commenter commented on pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #10811:
URL: https://github.com/apache/dubbo/pull/10811#issuecomment-1288508005

   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/10811?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#10811](https://codecov.io/gh/apache/dubbo/pull/10811?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (21beaff) into [3.2](https://codecov.io/gh/apache/dubbo/commit/fcb4aa5f5f646bfb5ec49f1985909b5e20d90ee6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fcb4aa5) will **decrease** coverage by `0.02%`.
   > The diff coverage is `58.15%`.
   
   ```diff
   @@             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     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/10811?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../dubbo/rpc/protocol/tri/call/TripleClientCall.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvY2FsbC9UcmlwbGVDbGllbnRDYWxsLmphdmE=) | `29.93% <7.69%> (-1.92%)` | :arrow_down: |
   | [...bo/rpc/protocol/tri/stream/TripleClientStream.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvc3RyZWFtL1RyaXBsZUNsaWVudFN0cmVhbS5qYXZh) | `50.00% <50.00%> (ø)` | |
   | [...rpc/protocol/tri/TriHttp2RemoteFlowController.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvVHJpSHR0cDJSZW1vdGVGbG93Q29udHJvbGxlci5qYXZh) | `54.58% <54.58%> (ø)` | |
   | [.../rpc/protocol/tri/TriHttp2LocalFlowController.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvVHJpSHR0cDJMb2NhbEZsb3dDb250cm9sbGVyLmphdmE=) | `55.73% <55.73%> (ø)` | |
   | [...dubbo/rpc/protocol/tri/TripleFlowControlFrame.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvVHJpcGxlRmxvd0NvbnRyb2xGcmFtZS5qYXZh) | `61.90% <61.90%> (ø)` | |
   | [.../protocol/tri/call/BiStreamServerCallListener.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvY2FsbC9CaVN0cmVhbVNlcnZlckNhbGxMaXN0ZW5lci5qYXZh) | `70.37% <66.66%> (-4.63%)` | :arrow_down: |
   | [.../protocol/tri/call/AbstractServerCallListener.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvY2FsbC9BYnN0cmFjdFNlcnZlckNhbGxMaXN0ZW5lci5qYXZh) | `70.45% <75.00%> (+0.45%)` | :arrow_up: |
   | [...tocol/tri/call/ServerStreamServerCallListener.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvY2FsbC9TZXJ2ZXJTdHJlYW1TZXJ2ZXJDYWxsTGlzdGVuZXIuamF2YQ==) | `76.47% <80.00%> (+3.74%)` | :arrow_up: |
   | [...pache/dubbo/rpc/protocol/tri/frame/TriDecoder.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvZnJhbWUvVHJpRGVjb2Rlci5qYXZh) | `83.58% <91.66%> (+2.22%)` | :arrow_up: |
   | [...he/dubbo/rpc/protocol/tri/TripleHttp2Protocol.java](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvVHJpcGxlSHR0cDJQcm90b2NvbC5qYXZh) | `92.53% <100.00%> (+0.73%)` | :arrow_up: |
   | ... and [32 more](https://codecov.io/gh/apache/dubbo/pull/10811/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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


[GitHub] [dubbo] asa3311 commented on a diff in pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
asa3311 commented on code in PR #10811:
URL: https://github.com/apache/dubbo/pull/10811#discussion_r1031148681


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/BiStreamServerCallListener.java:
##########
@@ -16,22 +16,28 @@
  */
 
 package org.apache.dubbo.rpc.protocol.tri.call;
-
+import io.netty.handler.codec.http2.Http2WindowUpdateFrame;
+import io.netty.handler.codec.http2.Http2Connection;
+import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.LoggerFactory;
 import org.apache.dubbo.common.stream.StreamObserver;
 import org.apache.dubbo.rpc.Invoker;
 import org.apache.dubbo.rpc.RpcInvocation;
 import org.apache.dubbo.rpc.TriRpcStatus;
 import org.apache.dubbo.rpc.protocol.tri.observer.ServerCallToObserverAdapter;
-
+import org.apache.dubbo.rpc.protocol.tri.TriHttp2LocalFlowController;
+import org.apache.dubbo.rpc.protocol.tri.TripleFlowControlFrame;
 public class BiStreamServerCallListener extends AbstractServerCallListener {
 
     private StreamObserver<Object> requestObserver;
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(BiStreamServerCallListener.class);
+
     public BiStreamServerCallListener(RpcInvocation invocation, Invoker<?> invoker,
         ServerCallToObserverAdapter<Object> responseObserver) {
         super(invocation, invoker, responseObserver);
         invocation.setArguments(new Object[]{responseObserver});
-        invoke();
+        invoke(null);

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


[GitHub] [dubbo] asa3311 commented on a diff in pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
asa3311 commented on code in PR #10811:
URL: https://github.com/apache/dubbo/pull/10811#discussion_r1031152458


##########
dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStreamTest.java:
##########
@@ -109,12 +110,13 @@ public void progress() {
         headers.set(TripleHeaderEnum.STATUS_KEY.getHeader(), TriRpcStatus.OK.code.code + "");
         headers.set(TripleHeaderEnum.CONTENT_TYPE_KEY.getHeader(),
             TripleHeaderEnum.CONTENT_PROTO.getHeader());
-        transportListener.onHeader(headers, false);
+        transportListener.onHeader(headers, false,null);
         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);

Review Comment:
   Didn't understand



-- 
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


[GitHub] [dubbo] asa3311 commented on pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
asa3311 commented on PR #10811:
URL: https://github.com/apache/dubbo/pull/10811#issuecomment-1326128771

   conflic too much,link https://github.com/apache/dubbo/pull/11011


-- 
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


[GitHub] [dubbo] asa3311 commented on a diff in pull request #10811: Triple flowcontrol

Posted by GitBox <gi...@apache.org>.
asa3311 commented on code in PR #10811:
URL: https://github.com/apache/dubbo/pull/10811#discussion_r1031151917


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriHttp2RemoteFlowController.java:
##########
@@ -0,0 +1,794 @@
+/*
+ * Copyright 2014 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.dubbo.rpc.protocol.tri;
+
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.util.internal.UnstableApi;
+import io.netty.util.internal.logging.InternalLogger;
+import io.netty.util.internal.logging.InternalLoggerFactory;
+import java.util.ArrayDeque;
+import java.util.Deque;
+import io.netty.handler.codec.http2.Http2Error;
+import static io.netty.handler.codec.http2.Http2Error.FLOW_CONTROL_ERROR;
+import static io.netty.handler.codec.http2.Http2Error.INTERNAL_ERROR;
+import static io.netty.handler.codec.http2.Http2Error.STREAM_CLOSED;
+import static io.netty.handler.codec.http2.Http2CodecUtil.DEFAULT_WINDOW_SIZE;
+import static io.netty.handler.codec.http2.Http2CodecUtil.MIN_WEIGHT;
+import static io.netty.handler.codec.http2.Http2CodecUtil.MAX_WEIGHT;
+import io.netty.handler.codec.http2.WeightedFairQueueByteDistributor;
+import io.netty.handler.codec.http2.StreamByteDistributor;
+import io.netty.handler.codec.http2.Http2StreamVisitor;
+import io.netty.handler.codec.http2.Http2Exception;
+import io.netty.handler.codec.http2.Http2ConnectionAdapter;
+import io.netty.handler.codec.http2.Http2Connection;
+import io.netty.handler.codec.http2.Http2RemoteFlowController;
+import io.netty.handler.codec.http2.Http2Stream;
+import org.apache.dubbo.common.config.Configuration;
+import org.apache.dubbo.common.config.ConfigurationUtils;
+import org.apache.dubbo.rpc.model.ApplicationModel;
+import static io.netty.handler.codec.http2.Http2Exception.streamError;
+import static io.netty.handler.codec.http2.Http2Stream.State.HALF_CLOSED_LOCAL;
+import static io.netty.util.internal.ObjectUtil.checkNotNull;
+import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
+import static java.lang.Math.max;
+import static java.lang.Math.min;
+import static org.apache.dubbo.rpc.Constants.H2_SETTINGS_INITIAL_WINDOW_SIZE_KEY;
+
+/**
+ * This design is learning from {@see io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController} which is in Netty.
+ */
+@UnstableApi

Review Comment:
   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.



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCall.java:
##########
@@ -173,12 +173,14 @@ public final void onComplete() {
     }
 
     @Override
-    public final void onMessage(byte[] message) {
+    public final void onMessage(TripleFlowControlFrame data) {

Review Comment:
   change to object



-- 
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