You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "leixm (via GitHub)" <gi...@apache.org> on 2025/11/05 07:12:13 UTC

[PR] Follow CELEBORN-1983. Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

leixm opened a new pull request, #3531:
URL: https://github.com/apache/celeborn/pull/3531

   ### What changes were proposed in this pull request?
   Fix fetch fail not throw due to reach spark maxTaskFailures.
   
   ### Why are the changes needed?
   The condition `ti.attemptNumber() >= maxTaskFails - 1` may not be executed. Suppose that the current `taskAttempts` is index0, index1, index2, and index3, and that index0 and index1 have already failed while index2 and index3 are running, and the current `reportFetchFailed` is index3, then the final result will be false, while the expected result will be true.
   Therefore, we should check the attemptNumber of the current task separately before the loop starts.
   
   ### Does this PR resolve a correctness bug?
   
   No.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   
   ### How was this patch tested?
   Existing UTs.
   


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "leixm (via GitHub)" <gi...@apache.org>.
leixm commented on code in PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#discussion_r2536437391


##########
client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -335,16 +335,19 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
         if (taskAttempts == null) return true;
 
         TaskInfo taskInfo = taskAttempts._1();
+        int failedTaskAttempts = 1;
+        boolean hasRunningAttempt = false;
         for (TaskInfo ti : taskAttempts._2()) {
           if (ti.taskId() != taskId) {
             if (reportedStageTaskIds.contains(ti.taskId())) {
               logger.info(
-                  "StageId={} index={} taskId={} attempt={} another attempt {} has reported shuffle fetch failure, ignore it.",
+                  "StageId={} index={} taskId={} attempt={} another attempt {} has reported shuffle fetch failure.",
                   stageId,
                   taskInfo.index(),
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
+              return true;

Review Comment:
   Seems it will eventually return true before being modified?



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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#discussion_r2536404775


##########
client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -335,16 +335,19 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
         if (taskAttempts == null) return true;
 
         TaskInfo taskInfo = taskAttempts._1();
+        int failedTaskAttempts = 1;
+        boolean hasRunningAttempt = false;
         for (TaskInfo ti : taskAttempts._2()) {
           if (ti.taskId() != taskId) {
             if (reportedStageTaskIds.contains(ti.taskId())) {
               logger.info(
-                  "StageId={} index={} taskId={} attempt={} another attempt {} has reported shuffle fetch failure, ignore it.",
+                  "StageId={} index={} taskId={} attempt={} another attempt {} has reported shuffle fetch failure.",
                   stageId,
                   taskInfo.index(),
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
+              return true;

Review Comment:
   Before, we ignore it.
   
   Why change it here?



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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas closed pull request #3531: [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures
URL: https://github.com/apache/celeborn/pull/3531


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#issuecomment-3555650021

   Thanks. Merged to main(v0.7.0) and branch-0.6(v0.6.2).


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#issuecomment-3525285102

   > Suppose that the current taskAttempts is index0, index1, index2, and index3, and that index0 and index1 have already failed while index2 and index3 are running, and the current reportFetchFailed is index3, then the final result will be false, while the expected result will be true.
   
   If we wait the result of attempt2, what would happen?
   


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "leixm (via GitHub)" <gi...@apache.org>.
leixm commented on PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#issuecomment-3550497274

   cc @SteNicholas  @RexXiong  


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#discussion_r2533878938


##########
client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -362,22 +365,41 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
-              return false;
-            }
-          } else {
-            if (ti.attemptNumber() >= maxTaskFails - 1) {
-              logger.warn(
-                  "StageId={} index={} taskId={} attemptNumber {} reach maxTaskFails {}.",
+              hasRunningAttempt = true;
+            } else if (ti.status() == "FAILED" || ti.status() == "UNKNOWN") {
+              // For KILLED state task, Spark does not count the number of failures
+              // For UNKNOWN state task, Spark does count the number of failures
+              // For FAILED state task, Spark decides whether to count the failure based on the
+              // different failure reasons. In this case, since we cannot obtain the failure reasons,
+              // we will count all tasks in FAILED state.
+              logger.info(
+                  "StageId={} index={} taskId={} attempt={} another attempt {} is failed.",

Review Comment:
   Log this status of `TaskInfo`.



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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "leixm (via GitHub)" <gi...@apache.org>.
leixm commented on PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#issuecomment-3544704352

   cc @RexXiong  @turboFei  


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "leixm (via GitHub)" <gi...@apache.org>.
leixm commented on PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#issuecomment-3489729280

   @turboFei  Can you help review?


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#discussion_r2533882891


##########
client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -362,22 +365,41 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
-              return false;
-            }
-          } else {
-            if (ti.attemptNumber() >= maxTaskFails - 1) {
-              logger.warn(
-                  "StageId={} index={} taskId={} attemptNumber {} reach maxTaskFails {}.",
+              hasRunningAttempt = true;
+            } else if (ti.status() == "FAILED" || ti.status() == "UNKNOWN") {
+              // For KILLED state task, Spark does not count the number of failures
+              // For UNKNOWN state task, Spark does count the number of failures
+              // For FAILED state task, Spark decides whether to count the failure based on the
+              // different failure reasons. In this case, since we cannot obtain the failure reasons,
+              // we will count all tasks in FAILED state.
+              logger.info(
+                  "StageId={} index={} taskId={} attempt={} another attempt {} is failed.",
                   stageId,
                   taskInfo.index(),
                   taskId,
-                  ti.attemptNumber(),
-                  maxTaskFails);
-              return true;
+                  taskInfo.attemptNumber(),
+                  ti.attemptNumber());
+              failedTaskAttempts += 1;
             }
           }
         }
-        return true;
+        // The following situations should trigger a FetchFailed exception:
+        //  1. If failedTaskAttempts >= maxTaskFails
+        //  2. If no other taskAttempts are running
+        if (failedTaskAttempts >= maxTaskFails) {

Review Comment:
   The condition of returning true could be merged to merged.



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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#discussion_r2536593712


##########
client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -335,16 +335,19 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
         if (taskAttempts == null) return true;
 
         TaskInfo taskInfo = taskAttempts._1();
+        int failedTaskAttempts = 1;
+        boolean hasRunningAttempt = false;
         for (TaskInfo ti : taskAttempts._2()) {
           if (ti.taskId() != taskId) {
             if (reportedStageTaskIds.contains(ti.taskId())) {
               logger.info(
-                  "StageId={} index={} taskId={} attempt={} another attempt {} has reported shuffle fetch failure, ignore it.",
+                  "StageId={} index={} taskId={} attempt={} another attempt {} has reported shuffle fetch failure.",
                   stageId,
                   taskInfo.index(),
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
+              return true;

Review Comment:
   It was false before.
   
   https://github.com/apache/celeborn/blob/3d61cede3f42155e3f895c52acc30e069655b77c/client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java#L413-L420
   
   
   ```
   Other attempts already reported shuffle fetch failures for the same task 
   ```



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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "leixm (via GitHub)" <gi...@apache.org>.
leixm commented on PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#issuecomment-3489739663

   Perhaps we shouldn't use attemptNumber as the criterion, but rather the number of completed taskAttempts.


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#issuecomment-3532885543

   I don't think this change is quite right. For example, if attempts 0 and 1 have already failed, attempt 2 is running, and attempt 3 reports failed, according to the modified logic it would return true. But in reality, it should return false because attempt 2 is still running. So we should check how many attempts have already failed. If the number of failed attempts has reached maxTaskFails, then it should return true.
   
   In the scenario you provided, when attempt 3 reports, although attempt 4 is running, attempts 0, 1, and 2 have already failed three times, plus this time makes it four failures. At this point, we shouldn’t ignore it; instead, we should determine that maxTaskFails has been reached and report a fetch failure. @leixm @turboFei 


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "AngersZhuuuu (via GitHub)" <gi...@apache.org>.
AngersZhuuuu commented on code in PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#discussion_r2533588813


##########
client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -460,14 +462,8 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
+              failedTaskAttempts += 1;

Review Comment:
   Should directly return true here



##########
client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -477,22 +473,36 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
-              return false;
-            }
-          } else {
-            if (ti.attemptNumber() >= maxTaskFails - 1) {
-              LOG.warn(
-                  "StageId={} index={} taskId={} attemptNumber {} reach maxTaskFails {}.",
+              hasRunningAttempt = true;
+            } else if (ti.status() == "FAILED") {
+              LOG.info(
+                  "StageId={} index={} taskId={} attempt={} another attempt {} is failed.",
                   stageId,
                   taskInfo.index(),
                   taskId,
-                  ti.attemptNumber(),
-                  maxTaskFails);
-              return true;
+                  taskInfo.attemptNumber(),
+                  ti.attemptNumber());
+              failedTaskAttempts += 1;
             }
           }
         }
-        return true;
+        // 1. If no other taskAttempts are running, a FetchFailed exception should be thrown.
+        // 2. If other taskAttempts are running, but failedTaskAttempts >= maxTaskFails,
+        // a FetchFailed exception should be thrown.
+        if (!hasRunningAttempt) {
+          return true;
+        } else if (failedTaskAttempts >= maxTaskFails) {

Review Comment:
   First check `failedTaskAttempts >= maxTaskFails` then check `hasRunningAttempt `? keep same with spark behavior?



##########
client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -477,22 +473,36 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
-              return false;
-            }
-          } else {
-            if (ti.attemptNumber() >= maxTaskFails - 1) {
-              LOG.warn(
-                  "StageId={} index={} taskId={} attemptNumber {} reach maxTaskFails {}.",
+              hasRunningAttempt = true;
+            } else if (ti.status() == "FAILED") {

Review Comment:
   It needs to define the same task status scope as Spark, such as KILLED or UNKNOWN.



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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "leixm (via GitHub)" <gi...@apache.org>.
leixm commented on PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#issuecomment-3525148299

   cc @turboFei  @SteNicholas  @AngersZhuuuu 


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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#discussion_r2536593712


##########
client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -335,16 +335,19 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
         if (taskAttempts == null) return true;
 
         TaskInfo taskInfo = taskAttempts._1();
+        int failedTaskAttempts = 1;
+        boolean hasRunningAttempt = false;
         for (TaskInfo ti : taskAttempts._2()) {
           if (ti.taskId() != taskId) {
             if (reportedStageTaskIds.contains(ti.taskId())) {
               logger.info(
-                  "StageId={} index={} taskId={} attempt={} another attempt {} has reported shuffle fetch failure, ignore it.",
+                  "StageId={} index={} taskId={} attempt={} another attempt {} has reported shuffle fetch failure.",
                   stageId,
                   taskInfo.index(),
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
+              return true;

Review Comment:
   It was false before.
   
   https://github.com/apache/celeborn/blob/3d61cede3f42155e3f895c52acc30e069655b77c/client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java#L413-L420



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


Re: [PR] [CELEBORN-1983][FOLLOWUP] Fix fetch fail not throw due to reach spark maxTaskFailures [celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #3531:
URL: https://github.com/apache/celeborn/pull/3531#discussion_r2533876219


##########
client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkUtils.java:
##########
@@ -362,22 +365,41 @@ public static boolean shouldReportShuffleFetchFailure(long taskId) {
                   taskId,
                   taskInfo.attemptNumber(),
                   ti.attemptNumber());
-              return false;
-            }
-          } else {
-            if (ti.attemptNumber() >= maxTaskFails - 1) {
-              logger.warn(
-                  "StageId={} index={} taskId={} attemptNumber {} reach maxTaskFails {}.",
+              hasRunningAttempt = true;
+            } else if (ti.status() == "FAILED" || ti.status() == "UNKNOWN") {

Review Comment:
   ```suggestion
               } else if ("FAILED".equals(ti.status()) || "UNKNOWN".equals(ti.status())) {
   ```



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