lenboo commented on a change in pull request #1532: fix 
MasterBaseTaskExecThread submit method bug
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/1532#discussion_r360347569
 
 

 ##########
 File path: 
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterBaseTaskExecThread.java
 ##########
 @@ -114,37 +114,37 @@ protected TaskInstance submit(){
         Integer commitRetryInterval = 
masterConfig.getMasterTaskCommitInterval();
 
         int retryTimes = 1;
-        boolean taskDBFlag = false;
-        boolean taskQueueFlag = false;
+        boolean submitDB = false;
+        boolean submitQueue = false;
         TaskInstance task = null;
-        while (true){
+        while (retryTimes <= commitRetryTimes){
             try {
-                if(!taskDBFlag){
+                if(!submitDB){
                     // submit task to db
                     task = processDao.submitTask(taskInstance, 
processInstance);
                     if(task != null && task.getId() != 0){
-                        taskDBFlag = true;
+                        submitDB = true;
                     }
                 }
-                if(taskDBFlag && !taskQueueFlag){
+                if(submitDB && !submitQueue){
                     // submit task to queue
-                    taskQueueFlag = processDao.submitTaskToQueue(task);
+                    submitQueue = processDao.submitTaskToQueue(task);
                 }
-                if(taskDBFlag && taskQueueFlag){
+                if(submitDB && submitQueue){
                     return task;
                 }
-                if(!taskDBFlag){
+                if(!submitDB){
                     logger.error("task commit to db failed , task has already 
retry {} times, please check the database", retryTimes);
-                }else if(!taskQueueFlag){
+                }else if(!submitDB){
 
 Review comment:
   is submitQueue?

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


With regards,
Apache Git Services

Reply via email to