You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/10/26 06:15:42 UTC

[GitHub] [rocketmq] jasonjavaYY opened a new issue, #5404: Variable of LatencyFaultToleranceImpl#whichItemWorst does not present the worst item

jasonjavaYY opened a new issue, #5404:
URL: https://github.com/apache/rocketmq/issues/5404

   the source code in rocketMQ is as follows:
   Collections.sort(tmpList);
   final int half = tmpList.size() / 2;
   if (half <= 0) {
        return tmpList.get(0).getName();
   } else {
        final int i = this.whichItemWorst.incrementAndGet() % half;
        return tmpList.get(i).getName();
   }
   According to the sorting rule of FaultItem, the last item in the tmpList is the worst, But the method returns a random element in the first half of the array.
   
   The steps to reproduce
   1、run the follow code:
   atencyFaultToleranceImpl impl = new LatencyFaultToleranceImpl();
   impl.updateFaultItem("a",10000,10000);
   impl.updateFaultItem("b",20000,10000);
   impl.updateFaultItem("c",30000,10000);
   impl.updateFaultItem("d",40000,10000);
   System.out.println(impl.pickOneAtLeast());
   2、expected to see:
   return "d", because "d" is the worst item.
   3、the real output instead:
   return "a" or "b".


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

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


Re: [I] Variable of LatencyFaultToleranceImpl#whichItemWorst does not present the worst item [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5404:
URL: https://github.com/apache/rocketmq/issues/5404#issuecomment-1793258039

   This issue was closed because it has been inactive for 3 days since being marked as stale.


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

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


[GitHub] [rocketmq] codersfarm commented on issue #5404: Variable of LatencyFaultToleranceImpl#whichItemWorst does not present the worst item

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

   Maybe the  variable `whichItemWorst`  name is ambiguous. i think. The method `LatencyFaultToleranceImpl#pickOneAtLeast` select one  broker from `faultItemTable` for current thread, because the client will retry send messages if send fail.


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

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


[GitHub] [rocketmq] jasonjavaYY commented on issue #5404: Variable of LatencyFaultToleranceImpl#whichItemWorst does not present the worst item

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

   I agree with you, but the variable name should be corrected to avoid ambiguity


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

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


Re: [I] Variable of LatencyFaultToleranceImpl#whichItemWorst does not present the worst item [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5404:
URL: https://github.com/apache/rocketmq/issues/5404#issuecomment-1786234220

   This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.


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

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


Re: [I] Variable of LatencyFaultToleranceImpl#whichItemWorst does not present the worst item [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #5404: Variable of LatencyFaultToleranceImpl#whichItemWorst does not present the worst item
URL: https://github.com/apache/rocketmq/issues/5404


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

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