xinghuayu007 commented on a change in pull request #4796:
URL: https://github.com/apache/incubator-doris/pull/4796#discussion_r513164269



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java
##########
@@ -233,7 +233,32 @@ public void onTaskFailed(long taskId, FailMsg failMsg) {
                 loadTask.updateRetryInfo();
                 idToTasks.put(loadTask.getSignature(), loadTask);
                 // load id will be added to loadStatistic when executing this 
task
-                
Catalog.getCurrentCatalog().getLoadTaskScheduler().submit(loadTask);
+                boolean retrySuccessFlag = false;
+                while (loadTask.getRetryTime() > 0) {
+                    try {
+                        
Catalog.getCurrentCatalog().getLoadTaskScheduler().submit(loadTask);
+                        retrySuccessFlag = true;
+                        break;
+                    } catch (Exception e) {
+                        try {
+                            Thread.sleep(100);
+                        } catch (InterruptedException ex) {
+                            LOG.warn("retry sublit task sleep failed. 
task_id:{}", id);
+                        }
+                        // retry task

Review comment:
       > The code is redundant:
   > 
   > ```
   >                         idToTasks.remove(loadTask.getSignature());
   >                         if (loadTask instanceof LoadLoadingTask) {
   >                             loadStatistic.removeLoad(((LoadLoadingTask) 
loadTask).getLoadId());
   >                         }
   >                         loadTask.updateRetryInfo();
   >                         idToTasks.put(loadTask.getSignature(), loadTask);
   > ```
   
   Maybe, it is better to catch the exception in 
`fe-core/src/main/java/org/apache/doris/task/MasterTaskExecutor.java#submit` 
and return false. But currently, too many calls refer this function, may need 
too much modfication.




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to