Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(task-framework): the pod was not released after the task was completed #2962

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ private void destroyExecutor(TaskFrameworkService taskFrameworkService, JobEntit
}
log.info("Job destroy executor succeed, jobId={}, status={}.", lockedEntity.getId(),
lockedEntity.getStatus());
} else if (lockedEntity.getStatus().isTerminated() && lockedEntity.getExecutorIdentifier() == null) {
// It is necessary to update the finish time when the job is terminated but the
// executorIdentifier is null, otherwise, the job cannot be released.
log.info("Executor not found, updating executor to destroyed,jobId={}", lockedEntity.getId());
taskFrameworkService.updateExecutorToDestroyed(lockedEntity.getId());
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ private void doRefreshResult(Long id) throws JobException {
taskResultPublisherExecutor.execute(() -> publisher
.publishEvent(new JobTerminateEvent(result.getJobIdentity(), result.getStatus())));

// TODO maybe we can destroy the pod there.
if (result.getStatus() == JobStatus.FAILED) {
AlarmUtils.alarm(AlarmEventNames.TASK_EXECUTION_FAILED,
MessageFormat.format("Job execution failed, jobId={0}",
Expand Down