zhoujinsong commented on code in PR #3675:
URL: https://github.com/apache/amoro/pull/3675#discussion_r2255734522


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingProcess.java:
##########
@@ -44,7 +44,11 @@ public interface OptimizingProcess {
 
   long getRunningQuotaTime(long calculatingStartTime, long calculatingEndTime);
 
+  boolean containSuccessTasks();

Review Comment:
   I am not sure if we need this public method, it seems it is only called 
inner the impelemenation.



##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingProcess.java:
##########
@@ -44,7 +44,11 @@ public interface OptimizingProcess {
 
   long getRunningQuotaTime(long calculatingStartTime, long calculatingEndTime);
 
+  boolean containSuccessTasks();
+
   void commit();
 
+  void commitClosedProcess();

Review Comment:
   Can we reuse the `commit` method? I don't see the need to implement a method 
exclusively for the process closing case.



##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java:
##########
@@ -507,14 +507,32 @@ private void acceptResult(TaskRuntime<?> taskRuntime) {
                 taskRuntime.getFailReason());
             retryTask(taskRuntime);
           } else {
-            LOG.info(
-                "Task {} has reached the max execute retry count. Process {} 
failed.",
-                taskRuntime.getTaskId(),
-                processId);
-            this.failedReason = taskRuntime.getFailReason();
-            this.status = ProcessStatus.FAILED;
-            this.endTime = taskRuntime.getEndTime();
-            persistAndSetCompleted(false);
+            try {
+              buildCommit().commit();

Review Comment:
   I don't think we should perform the commit action directly here. Instead, we 
should delegate the commit process to the `OptimizingCommitExecutor`, just like 
how we handle normal commits currently. 



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