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

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

liubao68 commented on a change in pull request #625: [SCB-444]try to optimize 
autoDiscovery function
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/625#discussion_r178417055
 
 

 ##########
 File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/IpPortManager.java
 ##########
 @@ -61,6 +67,7 @@ public IpPortManager(ServiceRegistryConfig 
serviceRegistryConfig, InstanceCacheM
     }
     int initialIndex = new Random().nextInt(defaultIpPort.size());
     currentAvailableIndex = new AtomicInteger(initialIndex);
+    maxRetryTimes = defaultIpPort.size() + (getDiscoveredIpPort() == null ? 0 
: getDiscoveredIpPort().size());
 
 Review comment:
   This code is not correct. maxRetryTimes is dynamically change and you can 
not getDiscoveryIpPort when initialize IpPortManager

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


> try to optimize autodiscovery function
> --------------------------------------
>
>                 Key: SCB-444
>                 URL: https://issues.apache.org/jira/browse/SCB-444
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Java-Chassis
>    Affects Versions: java-chassis-1.0.0-m2
>            Reporter: WeiChao
>            Assignee: TaoMeng
>            Priority: Minor
>             Fix For: java-chassis-1.0.0-m2
>
>




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

Reply via email to