You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/01/14 09:00:53 UTC
[GitHub] [incubator-dolphinscheduler] baiyibo commented on issue #4249: [Question]If an exception occurs in the taskExecuteThread, the task will be killed. However, the kill method only sets the status of taskInstance to kill state. But the MasterTaskExecThread will not handle the kill state and just wait.
baiyibo commented on issue #4249:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/4249#issuecomment-760045262
`try{
...
}catch (Exception e) {
logger.error("task scheduler failure", e);
kill();// some exception will go to kill
**responseCommand.setStatus(ExecutionStatus.FAILURE.getCode());**
responseCommand.setEndTime(new Date());
responseCommand.setProcessId(task.getProcessId());
responseCommand.setAppIds(task.getAppIds());
} finally {
taskExecutionContextCacheManager.removeByTaskInstanceId(taskExecutionContext.getTaskInstanceId());
ResponceCache.get().cache(taskExecutionContext.getTaskInstanceId(),responseCommand.convert2Command(),Event.RESULT);
taskCallbackService.sendResult(taskExecutionContext.getTaskInstanceId(), responseCommand.convert2Command());
}`
1.responseCommand.setStatus(ExecutionStatus.FAILURE.getCode());
This sentence has changed the status to failure
2.taskCallbackService.sendResult(taskExecutionContext.getTaskInstanceId(), responseCommand.convert2Command());
Reponse to master
3.in class TaskResponseProcessor
taskResponseService.addResponse(taskResponseEvent);
4.TaskResponseService.TaskResponseWorker.run() -> processService.changeTaskState
The status of the task instance is changed to failed
5.org.apache.dolphinscheduler.server.master.runner.MasterTaskExecThread#waitTaskQuit
taskInstance.getState().typeIsFinished() contain The name is failed state
so,break,waitTaskQuit->return ,There will be no obstruction
----------------------------------------------------------------
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:
users@infra.apache.org