You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "lennonchan (via GitHub)" <gi...@apache.org> on 2023/05/30 12:54:05 UTC

[GitHub] [servicecomb-java-chassis] lennonchan opened a new issue, #3818: 服务端多类型监听时,某一种类型监听故障时,loadbalance可能无法选择到正常类型的监听

lennonchan opened a new issue, #3818:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3818

   ServiceCombServer 类的equals方法在预期类型的情况下,只判断instanceId是否相等。
   ```
   public boolean equals(Object o) {
       if (o instanceof ServiceCombServer) {
         return this.instance.getInstanceId().equals(((ServiceCombServer) o).instance.getInstanceId());
       } else {
         return false;
       }
     }
   ```
   在一个服务实例有多个类型的监听时,如同时启动rest和highway,切highway故障的情况下,第一次尝试highway通信失败,在尝试使用rest通信时因为两个ServiceCombServer对象equals判断时返回成功,导致不会尝试rest通信。
   ```
   public Server chooseServer(Object key) {
         Invocation invocation = (Invocation) key;
         boolean isRetry = null != lastServer;
         for (int i = 0; i < COUNT; i++) {
           Server s = delegate.chooseServer(invocation);
           if (s == null) {
             break;
           }
           if (!s.equals(lastServer)) {  // lastServer为highway对应的Server,s 为rest对应的场景,因为s.equals(lastServer) == true,导致lb不尝试使用s通信
             lastServer = s;
             break;
           }
         }
         if (isRetry) {
           invocation.getTraceIdLogger().info(LOGGER, "retry to instance [{}]", lastServer.getHostPort());
         }
   
         return lastServer;
       }
   ```


-- 
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: commits-unsubscribe@servicecomb.apache.org.apache.org

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


[GitHub] [servicecomb-java-chassis] lbc97 commented on issue #3818: 服务端多类型监听时,某一种类型监听故障时,loadbalance可能无法选择到正常类型的监听

Posted by "lbc97 (via GitHub)" <gi...@apache.org>.
lbc97 commented on issue #3818:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3818#issuecomment-1569376005

   为什么要同时使用两种协议监听呢 能说一下使用场景 和发生问题的具体场景吗,就是为什么 highway通信会失败


-- 
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: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] lbc97 commented on issue #3818: 服务端多类型监听时,某一种类型监听故障时,loadbalance可能无法选择到正常类型的监听

Posted by "lbc97 (via GitHub)" <gi...@apache.org>.
lbc97 commented on issue #3818:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3818#issuecomment-1569351021

   同时启动rest和highway 指的是配置文件同时配上rest和highway配置吗


-- 
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: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] lennonchan commented on issue #3818: 服务端多类型监听时,某一种类型监听故障时,loadbalance可能无法选择到正常类型的监听

Posted by "lennonchan (via GitHub)" <gi...@apache.org>.
lennonchan commented on issue #3818:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3818#issuecomment-1569655818

   问题在下面的commit里面修复了
   https://github.com/apache/servicecomb-java-chassis/commit/6e39d6b8d01c117c966b9a941e6de0b743970a37


-- 
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: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] lennonchan closed issue #3818: 服务端多类型监听时,某一种类型监听故障时,loadbalance可能无法选择到正常类型的监听

Posted by "lennonchan (via GitHub)" <gi...@apache.org>.
lennonchan closed issue #3818: 服务端多类型监听时,某一种类型监听故障时,loadbalance可能无法选择到正常类型的监听
URL: https://github.com/apache/servicecomb-java-chassis/issues/3818


-- 
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: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] lennonchan commented on issue #3818: 服务端多类型监听时,某一种类型监听故障时,loadbalance可能无法选择到正常类型的监听

Posted by "lennonchan (via GitHub)" <gi...@apache.org>.
lennonchan commented on issue #3818:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3818#issuecomment-1569374731

   是的,服务端同时开启了两种协议的监听,microservice.yaml配置文件相关字段如下:
   ```
     rest:
       address: 0.0.0.0:12345
     highway:
       address: 0.0.0.0:11520
   ```


-- 
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: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] lennonchan commented on issue #3818: 服务端多类型监听时,某一种类型监听故障时,loadbalance可能无法选择到正常类型的监听

Posted by "lennonchan (via GitHub)" <gi...@apache.org>.
lennonchan commented on issue #3818:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3818#issuecomment-1569603648

   因为一些版本上的历史原因不同的通信平面使用了不同的协议。highway失败是测试构造的平面通信故障可靠性测试场景。


-- 
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: commits-unsubscribe@servicecomb.apache.org

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