diff --git a/kun-workflow/kun-workflow-executor/src/main/java/com/miotech/kun/workflow/executor/local/LocalExecutor.java b/kun-workflow/kun-workflow-executor/src/main/java/com/miotech/kun/workflow/executor/local/LocalExecutor.java index ec7d3dc44..59c022ce5 100644 --- a/kun-workflow/kun-workflow-executor/src/main/java/com/miotech/kun/workflow/executor/local/LocalExecutor.java +++ b/kun-workflow/kun-workflow-executor/src/main/java/com/miotech/kun/workflow/executor/local/LocalExecutor.java @@ -384,9 +384,8 @@ public void run() { } private void handleTimeoutAttempt(Long taskAttemptId) { - workerToken.release(); - logger.debug("taskAttemptId = {} release worker token, current size = {}", taskAttemptId, workerToken.availablePermits()); - workerPool.remove(taskAttemptId); + //kill worker when worker time out + killTaskAttempt(taskAttemptId); miscService.changeTaskAttemptStatus(taskAttemptId, TaskRunStatus.ERROR); TaskAttempt taskAttempt = taskRunDao.fetchAttemptById(taskAttemptId).get(); submit(taskAttempt, true); @@ -414,6 +413,7 @@ public void run() { if (worker.shutdown()) { workerPool.remove(taskAttemptId); workerToken.release(); + logger.debug("taskAttemptId = {} release worker token, current size = {}", taskAttemptId, workerToken.availablePermits()); notifyFinished(taskAttemptId, TaskRunStatus.ABORTED, OperatorReport.BLANK); miscService.changeTaskAttemptStatus(taskAttemptId, TaskRunStatus.ABORTED, null, DateTimeUtils.now());