You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "zwangsheng (via GitHub)" <gi...@apache.org> on 2023/08/14 07:39:58 UTC

[GitHub] [incubator-celeborn] zwangsheng commented on a diff in pull request #1811: [CELEBORN-888][WORKER]Tweak the logic and add unit tests for the MemoryManager#currentServingState method

zwangsheng commented on code in PR #1811:
URL: https://github.com/apache/incubator-celeborn/pull/1811#discussion_r1293081901


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/memory/MemoryManager.java:
##########
@@ -139,51 +139,56 @@ private MemoryManager(CelebornConf conf) {
     readBufferTarget = (long) (readBufferThreshold * readBufferTargetRatio);
     memoryShuffleStorageThreshold = (long) (maxDirectorMemory * shuffleStorageRatio);
 
-    checkService.scheduleWithFixedDelay(
-        () -> {
-          try {
-            ServingState lastState = servingState;
-            servingState = currentServingState();
-            if (lastState != servingState) {
-              logger.info("Serving state transformed from {} to {}", lastState, servingState);
-              if (servingState == ServingState.PUSH_PAUSED) {
-                pausePushDataCounter.increment();
-                logger.info("Trigger action: PAUSE PUSH, RESUME REPLICATE");
-                memoryPressureListeners.forEach(
-                    memoryPressureListener ->
-                        memoryPressureListener.onPause(TransportModuleConstants.PUSH_MODULE));
-                memoryPressureListeners.forEach(
-                    memoryPressureListener ->
-                        memoryPressureListener.onResume(TransportModuleConstants.REPLICATE_MODULE));
-                trimAllListeners();
-              } else if (servingState == ServingState.PUSH_AND_REPLICATE_PAUSED) {
-                pausePushDataAndReplicateCounter.increment();
-                logger.info("Trigger action: PAUSE PUSH and REPLICATE");
-                memoryPressureListeners.forEach(
-                    memoryPressureListener ->
-                        memoryPressureListener.onPause(TransportModuleConstants.PUSH_MODULE));
-                memoryPressureListeners.forEach(
-                    memoryPressureListener ->
-                        memoryPressureListener.onPause(TransportModuleConstants.REPLICATE_MODULE));
-                trimAllListeners();
+    // disabled trim thread in test case

Review Comment:
   During the unit test, we want to trigger the threshold for each state, in order to avoid this thread, reset the current service state.
   
   For example, we set sortMemory to trigger PAUSE_PUSH state, we don't want this thread trim memory.



-- 
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: issues-unsubscribe@celeborn.apache.org

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