pan3793 commented on code in PR #3084:
URL: https://github.com/apache/celeborn/pull/3084#discussion_r1944054470


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/memory/MemoryManager.java:
##########
@@ -330,6 +330,11 @@ public ServingState currentServingState() {
   public void switchServingState() {
     ServingState lastState = servingState;
     servingState = currentServingState();
+    if (servingState == lastState && servingState == ServingState.NONE_PAUSED) 
{
+      // this means that there is no memory pressure here
+      // skip the rest check logic of memory checker
+      return;
+    }
     logger.info("Serving state transformed from {} to {}", lastState, 
servingState);

Review Comment:
   how about simply wrapping the logging stmt with `if (servingState != 
lastState)`?
   
   if this is not the perf-sensitive code path, better to avoid introducing 
additional control flow



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to