ruanwenjun commented on code in PR #11480:
URL: https://github.com/apache/dolphinscheduler/pull/11480#discussion_r947665442


##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskDispatchProcessor.java:
##########
@@ -202,7 +198,12 @@ public void process(Channel channel, Command command) {
                         workerManager.getWaitSubmitQueueSize(),
                         taskExecutionContext.getTaskInstanceId());
                 workerMessageSender.sendMessageWithRetry(taskExecutionContext, 
masterAddress, CommandType.TASK_REJECT);
+                throw new TaskException("The task waiting queue is full, will 
reject this task");
             }
+        } catch (Exception ex) {
+            logger.error("Worker handle the dispatch task message failed, will 
remove the taskExecutionContext: {} from cache", taskExecutionContext);
+            
TaskExecutionContextCacheManager.removeByTaskInstanceId(taskExecutionContext.getTaskInstanceId());
+            throw ex;

Review Comment:
   Yes, the worker should send message to master be throw exception in the 
dispatch stage.



##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskDispatchProcessor.java:
##########
@@ -202,7 +198,12 @@ public void process(Channel channel, Command command) {
                         workerManager.getWaitSubmitQueueSize(),
                         taskExecutionContext.getTaskInstanceId());
                 workerMessageSender.sendMessageWithRetry(taskExecutionContext, 
masterAddress, CommandType.TASK_REJECT);
+                throw new TaskException("The task waiting queue is full, will 
reject this task");
             }
+        } catch (Exception ex) {
+            logger.error("Worker handle the dispatch task message failed, will 
remove the taskExecutionContext: {} from cache", taskExecutionContext);
+            
TaskExecutionContextCacheManager.removeByTaskInstanceId(taskExecutionContext.getTaskInstanceId());
+            throw ex;

Review Comment:
   Yes, the worker should send message to master before throw exception in the 
dispatch stage.



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