You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/06/09 15:59:37 UTC

[GitHub] [rocketmq] biggerRice opened a new issue #2080: LatencyFaultToleranceImpl#pickOneAtLeast()

biggerRice opened a new issue #2080:
URL: https://github.com/apache/rocketmq/issues/2080


   source code class
   https://github.com/apache/rocketmq/blob/master/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java
   
   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   - What did you do (The steps to reproduce)?
   
   - What did you expect to see?
   
   - What did you see instead?
   
   2. Please tell us about your environment:
   
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
   
   
   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   
   在 pickOneAtLeast 方法里面,有代码片段如下:
   
   Collections.shuffle(tmpList);
   
   Collections.sort(tmpList);
   
   对broker列表先打散,再排序,认为就失去了打散的作用,出现总是一个顺序,而出现压力都到了一个broker上
   
   认为应该去掉打散操作,改为
   
   Collections.sort(tmpList);
   


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

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



[GitHub] [rocketmq] lizhiboo commented on issue #2080: LatencyFaultToleranceImpl#pickOneAtLeast()

Posted by GitBox <gi...@apache.org>.
lizhiboo commented on issue #2080:
URL: https://github.com/apache/rocketmq/issues/2080#issuecomment-647503113


   > source code class
   > https://github.com/apache/rocketmq/blob/master/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java
   > 
   > **BUG REPORT**
   > 
   > source code :
   > 
   > ` @override
   > public String pickOneAtLeast() {
   > final Enumeration elements = this.faultItemTable.elements();
   > List tmpList = new LinkedList();
   > while (elements.hasMoreElements()) {
   > final FaultItem faultItem = elements.nextElement();
   > tmpList.add(faultItem);
   > }
   > 
   > ```
   >     if (!tmpList.isEmpty()) {
   >         Collections.shuffle(tmpList);
   > 
   >         Collections.sort(tmpList);
   > 
   >         final int half = tmpList.size() / 2;
   >         if (half <= 0) {
   >             return tmpList.get(0).getName();
   >         } else {
   >             final int i = this.whichItemWorst.getAndIncrement() % half;
   >             return tmpList.get(i).getName();
   >         }
   >     }
   > 
   >     return null;
   > }
   > ```
   > 
   > `
   > 
   > **FEATURE REQUEST**
   > 
   > 在 pickOneAtLeast 方法里面,有代码片段如下:
   > 
   > Collections.shuffle(tmpList);
   > 
   > Collections.sort(tmpList);
   > 
   > 对broker列表先打散,再排序,认为就失去了打散的作用,导致总是一个固有顺序,而出现压力都到了一个broker上
   > 
   > 认为改为
   > 
   > Collections.sort(tmpList);
   > 
   > 去掉
   > 
   > Collections.shuffle(tmpList); 这行没起作用
   
   I think it's a code mistake, it's no meaning call shuffle before sort. Can u submit a PR to fix it?


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

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



[GitHub] [rocketmq] yuz10 commented on issue #2080: LatencyFaultToleranceImpl#pickOneAtLeast()

Posted by GitBox <gi...@apache.org>.
yuz10 commented on issue #2080:
URL: https://github.com/apache/rocketmq/issues/2080#issuecomment-997965821


   Close for duplication with #2870


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] imaffe commented on issue #2080: LatencyFaultToleranceImpl#pickOneAtLeast()

Posted by GitBox <gi...@apache.org>.
imaffe commented on issue #2080:
URL: https://github.com/apache/rocketmq/issues/2080#issuecomment-645121340


   Interesting, I don't know if it is intended but it do looks weird. What do you think @ShannonDing 


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

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



[GitHub] [rocketmq] yuz10 closed issue #2080: LatencyFaultToleranceImpl#pickOneAtLeast()

Posted by GitBox <gi...@apache.org>.
yuz10 closed issue #2080:
URL: https://github.com/apache/rocketmq/issues/2080


   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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