abstractdog commented on code in PR #515:
URL: https://github.com/apache/tez/pull/515#discussion_r3499308319


##########
tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/MergeManager.java:
##########
@@ -402,7 +402,15 @@ private boolean canShuffleToMemory(long requestedSize) {
   public synchronized void waitForShuffleToMergeMemory() throws 
InterruptedException {
     long startTime = System.currentTimeMillis();
     while(usedMemory > memoryLimit) {
-      wait();
+      wait(1000);
+      if (usedMemory > memoryLimit && !inMemoryMapOutputs.isEmpty()) {
+        // Avoid deadlock: if memory is over limit but commitMemory is below 
mergeThreshold,
+        // no merge will be triggered automatically. Force a merge to free 
memory.
+        LOG.info("Memory limit exceeded with no merge triggered (usedMemory=" 
+ usedMemory
+            + ", commitMemory=" + commitMemory + ", mergeThreshold=" + 
mergeThreshold
+            + "). Forcing in-memory merge to avoid deadlock.");

Review Comment:
   please replace this with string logging format



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