[ 
https://issues.apache.org/jira/browse/SCB-706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542420#comment-16542420
 ] 

ASF GitHub Bot commented on SCB-706:
------------------------------------

liubao68 commented on a change in pull request #803:  [SCB-706]change filters 
to discovery filters and support invocation based filters
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/803#discussion_r202225963
 
 

 ##########
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServer.java
 ##########
 @@ -79,29 +69,16 @@ public String getHost() {
     return endpoint.getEndpoint();
   }
 
-  public void clearContinuousFailure() {
-    continuousFailureCount.set(0);
-  }
-
-  public void incrementContinuousFailureCount() {
-    if (continuousFailureCount.get() < Integer.MAX_VALUE) {
-      continuousFailureCount.incrementAndGet();
-    }
-  }
-
-  public int getCountinuousFailureCount() {
-    return continuousFailureCount.get();
-  }
-
+  // take endpoints that belongs to same instance as same server
   public boolean equals(Object o) {
-    if (o instanceof CseServer) {
-      return this.getHost().equals(((CseServer) o).getHost());
+    if (o instanceof ServiceCombServer) {
 
 Review comment:
   DiscoveryFilter sees MicroserviceInstance, not Endpoint. And the health 
check is also to MicroserviceInstance, not Endpoint. I modified server same 
when MicroserviceInstance is same to make all these place consistence to each 
other. (like when invocation failed, we mark instance status to failure for one 
time, but not endpoint failed.)

----------------------------------------------------------------
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:
us...@infra.apache.org


> refactor loadbalance filters logic to support invocation based filter
> ---------------------------------------------------------------------
>
>                 Key: SCB-706
>                 URL: https://issues.apache.org/jira/browse/SCB-706
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>            Reporter: liubao
>            Assignee: liubao
>            Priority: Major
>
> Why we do this?
>  # When implement invocation based filter, e.g. darklaunch deployment, we 
> need to filter servers based on invocation parameters. But now, we create a 
> Loadbalaner instance for each service, and Robin filter interface can not 
> pass Invocation to it. Before refactor, we doing this by ThreadLocal and 
> cache Invocation, and use in filter implementation. This is error prone and 
> users can't handle this complixity
>  # We have other improvements, e.g. SCB-700, we can do server status check, 
> and add a filter a choose from active servers. We need to consider filter 
> orders and other feature, current implementation not satisfy this.
>  # We want to make loadbalance code handy by remove some compatible fixes. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to