jobset icon indicating copy to clipboard operation
jobset copied to clipboard

Investigate restarting pods in-place as a mechanism for faster failure recovery

Open danielvegamyhre opened this issue 2 years ago • 37 comments

What would you like to be added: A faster restart/failure recovery mechanism that doesn't involve recreating all the child jobs, rescheduling all of the pods, etc.

Why is this needed: For faster failure recovery, reducing downtime for batch/training workloads which experience some kind of error.

danielvegamyhre avatar Mar 22 '24 19:03 danielvegamyhre

Reading this, why wouldn't one just want to use BackOffLimit in the job template?

kannon92 avatar Mar 22 '24 19:03 kannon92

Reading this, why wouldn't one just want to use BackOffLimit in the job template?

BackoffLimit only applies to that particular Job, but we need any pod failure in any Job to trigger pod restarts across all Jobs.

danielvegamyhre avatar Mar 22 '24 19:03 danielvegamyhre

Sorry, I just joined this project and I'm still trying to understand many things. I'm not sure if I'm thinking correctly. I want to confirm whether the intention is to restart the entire ReplicatedJobs when any job fails, or to restart the entire jobset.

googs1025 avatar Mar 30 '24 16:03 googs1025

Sorry, I just joined this project and I'm still trying to understand many things. I'm not sure if I'm thinking correctly. I want to confirm whether the intention is to restart the entire ReplicatedJobs when any job fails, or to restart the entire jobset.

Right now it means the entire jobset, but after #381 is implemented, it will depend on if (and how) a failure policy is configured.

danielvegamyhre avatar Mar 31 '24 23:03 danielvegamyhre

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 30 '24 00:06 k8s-triage-robot

/remove-lifecycle stale

ahg-g avatar Jun 30 '24 03:06 ahg-g

Update: After prototyping and investigating this further, I've identified 2 upstream changes that will be needed for approaches based on "kill container process to force Kubelet to recreate it" logic:

  1. In the Job API, if a PodFailurePolicy is defined, pods must use "restartPolicy: Never" so we cannot use a podFailurePolicy to ignore the container exit code resulting from "killall5" while not ignoring real container failures. We need to relax this validation, but it is more complicated than it sounds, there are various edge cases that need to be handled. I opened a Github issue to track this and will try to drive a resolution here: https://github.com/kubernetes/kubernetes/issues/125677

  2. Kubelet backoff policy for container restarts cannot be tuned/configured, so it very quickly becomes more efficient to simply delete+recreate all pods rather than restart containers in place. I found there is already an upstream feature request for this: https://github.com/kubernetes/kubernetes/issues/57291. Discussed it with tallclair@ and they are targeting alpha in v1.32.

I'll continue pursuing these upstream while I investigate alternatives for the short-term.

danielvegamyhre avatar Jun 30 '24 23:06 danielvegamyhre

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Oct 13 '24 23:10 k8s-triage-robot

/remove-lifecycle stale

I have another idea for how to do this actually, I may try prototyping it

danielvegamyhre avatar Oct 13 '24 23:10 danielvegamyhre