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 09:37:22 UTC

[GitHub] [rocketmq] zhouxinyu commented on a diff in pull request #5739: [ISSUE #5738] remove uselesscode in updateFaultItem

zhouxinyu commented on code in PR #5739:
URL: https://github.com/apache/rocketmq/pull/5739#discussion_r1053103159


##########
client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java:
##########
@@ -37,11 +37,7 @@ public void updateFaultItem(final String name, final long currentLatency, final
             faultItem.setCurrentLatency(currentLatency);
             faultItem.setStartTimestamp(System.currentTimeMillis() + notAvailableDuration);
 
-            old = this.faultItemTable.putIfAbsent(name, faultItem);
-            if (old != null) {
-                old.setCurrentLatency(currentLatency);
-                old.setStartTimestamp(System.currentTimeMillis() + notAvailableDuration);
-            }
+            this.faultItemTable.putIfAbsent(name, faultItem);

Review Comment:
   The original code is used to update the latency to exists fault item. Could you please write a test case to verify your issue?



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