This is an automated email from the ASF dual-hosted git repository.

nathanma pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new a2bc71ab7 [AMORO-3110] Do not throw exception when retry task in 
optimizer keeper (#3223)
a2bc71ab7 is described below

commit a2bc71ab7360760035b55ade676dcab2d90e6b74
Author: Xavier Bai <[email protected]>
AuthorDate: Thu Sep 26 17:29:30 2024 +0800

    [AMORO-3110] Do not throw exception when retry task in optimizer keeper 
(#3223)
    
    Do not throw exception when retry task in optimizer keeper
---
 .../org/apache/amoro/server/DefaultOptimizingService.java  | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/amoro-ams/src/main/java/org/apache/amoro/server/DefaultOptimizingService.java 
b/amoro-ams/src/main/java/org/apache/amoro/server/DefaultOptimizingService.java
index 1b206ca6e..6e8924b18 100644
--- 
a/amoro-ams/src/main/java/org/apache/amoro/server/DefaultOptimizingService.java
+++ 
b/amoro-ams/src/main/java/org/apache/amoro/server/DefaultOptimizingService.java
@@ -33,6 +33,7 @@ import org.apache.amoro.properties.CatalogMetaProperties;
 import org.apache.amoro.resource.Resource;
 import org.apache.amoro.resource.ResourceGroup;
 import org.apache.amoro.server.exception.ForbiddenException;
+import org.apache.amoro.server.exception.IllegalTaskStateException;
 import org.apache.amoro.server.exception.ObjectNotExistsException;
 import org.apache.amoro.server.exception.PluginRetryAuthException;
 import org.apache.amoro.server.exception.TaskNotFoundException;
@@ -147,8 +148,8 @@ public class DefaultOptimizingService extends 
StatedPersistentBase
         .forEach(groupName -> LOG.warn("Unloaded task runtime in group {}", 
groupName));
   }
 
-  private void registerOptimizer(OptimizerInstance optimizer, boolean 
needPersistency) {
-    if (needPersistency) {
+  private void registerOptimizer(OptimizerInstance optimizer, boolean 
needPersistent) {
+    if (needPersistent) {
       doAs(OptimizerMapper.class, mapper -> mapper.insertOptimizer(optimizer));
     }
 
@@ -565,7 +566,14 @@ public class DefaultOptimizingService extends 
StatedPersistentBase
           task.getTaskId(),
           task.getResourceDesc());
       // optimizing task of suspending optimizer would not be counted for 
retrying
-      queue.retryTask(task);
+      try {
+        queue.retryTask(task);
+      } catch (IllegalTaskStateException e) {
+        LOG.error(
+            "Retry task {} failed due to {}, will check it in next round",
+            task.getTaskId(),
+            e.getMessage());
+      }
     }
 
     private Predicate<TaskRuntime> buildSuspendingPredication(Set<String> 
activeTokens) {

Reply via email to