Skip to content

A successful Job will most likely read as Failed. #127

Open

Description

@kerthcet

What happened:

As the title mentioned, a Pod succeeded with exit code == 0 will be marked as Failed, which is not right.

Image

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

Activity

  1. added
    bugCategorizes issue or PR as related to a bug.
    on Oct 1, 2026
  2. kerthcet commented on Oct 1, 2026

    @kerthcet
    MemberAuthor

    /milestone v0.2.0

  3. added
    needs-triageIndicates an issue or PR lacks a label and requires one.
    needs-priorityIndicates a PR lacks a label and requires one.
    on Oct 1, 2026
  4. added this to the v0.2.0 milestone on Oct 1, 2026
  5. kerthcet commented on Oct 1, 2026

    @kerthcet
    MemberAuthor

    /help

  6. Sarthak-Shreshtha01 commented on Oct 1, 2026

    @Sarthak-Shreshtha01
    Contributor

    I skip reaping Pods in the Succeeded phase in the pod placement helpers, so a finished Job no longer reads as Failed. I added a test for it in the pod placement controller tests. (PR: #128)

  7. kerthcet commented on Oct 1, 2026

    @kerthcet
    MemberAuthor

    Hi @Sarthak-Shreshtha01 thanks for your interest, I think this is more complex than just skipping reaping Pods.

    • I agree we should not delete the succeeded Pods since the corresponding instances are already terminated when we get the status.
    • Exit codes are not recorded, every terminated instances is marked as Failed, that's the main problem for this issue. We should tell them apart, if exitcode is 0, succeeded, else, failed. Something like this.
    • We should add validation to the Job, only allow restartPolicy == Never, because we don't support restart the container today, we can only recreate the whole Pod which will recreate the instance.
    • When recreating the failed Pods, we should respect the backoffLimit of the Job, once we hit the limit, we should not delete the failed pods as well.

    More advanced:

    • to avoid potential instance leak, once we have succeeded and failed Pods, we may still need to call the termination API but don't delete the Pods, let the Job controller to manage them.

    We may have more gaps to support Job here but we can optimize them step by step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategorizes issue or PR as related to a bug.help wantedExtra attention is neededneeds-priorityIndicates a PR lacks a label and requires one.needs-triageIndicates an issue or PR lacks a label and requires one.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions