Skip to content

Commit

Permalink
syncctl: task timeout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Sep 5, 2023
1 parent 862d5fa commit 6a3c992
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sync-controller/job_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ func (j *JobRunner) watchPodStatuses() {
} else {
if timeMark, ok := j.runningPods[pod.Name]; !ok || time.Now().Sub(timeMark) >= time.Minute {
if time.Now().Sub(taskStatus.StartedAtTime()) > time.Hour*time.Duration(j.config.TaskTimeoutHours) {
taskStatus.Status = StatusFailed
taskStatus.Description = fmt.Sprintf("Task timeout: task %s is running for more than %d hours.", taskStatus.TaskID, j.config.TaskTimeoutHours)
j.Errorf("Pod %s is running for more than %d hours. Deleting", pod.Name, j.config.TaskTimeoutHours)
j.cleanupPod(pod.Name)
continue
} else {
taskStatus.Status = StatusRunning
j.Infof("Pod %s is running", pod.Name)
Expand Down

0 comments on commit 6a3c992

Please sign in to comment.