Skip to content

Commit

Permalink
fix worker timeout (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
shikimoe authored Jan 13, 2021
1 parent 27b1dd4 commit 9c28e15
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 9c28e15

Please sign in to comment.