wujimin commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212784912
 
 

 ##########
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/LoadbalanceHandler.java
 ##########
 @@ -148,16 +146,13 @@ public LoadbalanceHandler() {
 
   @Override
   public void handle(Invocation invocation, AsyncResponse asyncResp) throws 
Exception {
-    String policy = 
Configuration.INSTANCE.getPolicy(invocation.getMicroserviceName());
     String strategy = 
Configuration.INSTANCE.getRuleStrategyName(invocation.getMicroserviceName());
-    boolean isRuleNotChanged = isEqual(policy, this.policy) && 
isEqual(strategy, this.strategy);
-    if (!isRuleNotChanged) {
+    if (!isEqual(strategy, this.strategy)) {
       //配置变化,需要重新生成所有的lb实例
       synchronized (lock) {
         clearLoadBalancer();
       }
     }
-    this.policy = policy;
     this.strategy = strategy;
     LoadBalancer loadBalancer = getOrCreateLoadBalancer(invocation);
 
 Review comment:
   better to make loadBalancer statless
   1.invoke discoveryTree before getOrCreateLoadBalancer
   2.getOrCreateLoadBalancer
   3.send or sendWithRetry with server list
     chooseServer with server list
     create RetryLoadBalancer instance with server list

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to