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/12/20 03:29:45 UTC

[GitHub] [rocketmq] xiaoyifang opened a new issue, #5738: [code optimization] useless code in updateFaultItem

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

   https://github.com/apache/rocketmq/blob/e77d0673f8f96c7aff3a2252d79f87952539c7e4/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java#L41-L44
   
   the `old` returned from putIfAbsent must be null,even not null ,changed the value returned by putIfAbsent is useless.
   because
   ![image](https://user-images.githubusercontent.com/105986/208576125-4f135548-d301-4353-bcb9-7c5104cd0c01.png)
   


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


[GitHub] [rocketmq] HScarb commented on issue #5738: [code optimization] simplify the method updateFaultItem

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

   Your code create a new `FaultItem` every time, I think it's not necessary when old item exists.


-- 
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] xiaoyifang closed issue #5738: [code optimization] simplify the method updateFaultItem

Posted by GitBox <gi...@apache.org>.
xiaoyifang closed issue #5738: [code optimization] simplify the method updateFaultItem
URL: https://github.com/apache/rocketmq/issues/5738


-- 
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] xiaoyifang commented on issue #5738: [code optimization] simplify the method updateFaultItem

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

   > Your code create a new FaultItem every time, I think it's not necessary when old item exists.
   
   update the old existed item is a little complex in concurrent situations as the original code just did. 
   the code did create new item every time ,but the GC should ease the trouble at last. 
   
   At last I think your concern is reasonable 


-- 
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] xiaoyifang closed issue #5738: [code optimization] useless code in updateFaultItem

Posted by GitBox <gi...@apache.org>.
xiaoyifang closed issue #5738: [code optimization] useless code in updateFaultItem
URL: https://github.com/apache/rocketmq/issues/5738


-- 
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] xiaoyifang commented on issue #5738: [code optimization] useless code in updateFaultItem

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

   original code is ok.


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