Skip to content

Pod shall not transition from terminated phase: "Failed" -> "Succeeded" #17595

Closed

Description

@0xmichalis
/go/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/test/extended/deployments/deployments.go:1299
2017-12-05 09:50:41.393147976 +0000 UTC: detected deployer pod transition from terminated phase: "Failed" -> "Succeeded"
Expected
    <bool>: true
to be false
/go/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/test/extended/deployments/util.go:727

https://openshift-gce-devel.appspot.com/build/origin-ci-test/pr-logs/pull/17589/test_pull_request_origin_extended_conformance_install/3497/

/sig master
/kind test-flake
/assign mfojtik tnozicka

xref https://bugzilla.redhat.com/show_bug.cgi?id=1534492

Activity

  1. added
    kind/test-flake
    on Dec 5, 2017
  2. tnozicka commented on Dec 5, 2017

    @tnozicka
    Contributor

    @sjenning it seems to already have #17514

    I don't think your condition prevents failed->succeded

    if oldStatus.State.Terminated != nil && newStatus.State.Terminated == nil {

    There few other flakes likely caused by kubelet not respecting pod state transition diagram:

    /assign @sjenning
    /unassign @tnozicka @mfojtik
    /priority P0

  3. tnozicka commented on Dec 5, 2017

    @tnozicka
    Contributor

    (previous issue #17011)

  4. changed the title [-]deploymentconfigs keep the deployer pod invariant valid [Conformance] should deal with config change in case the deployment is still running [Suite:openshift/conformance/parallel][/-] [+]Pod shall not transition from terminated phase: "Failed" -> "Succeeded"[/+] on Dec 5, 2017
  5. 7 remaining items

  6. sjenning commented on Jan 30, 2018

    @sjenning
    Contributor

    @tnozicka just wondering, have you seen this one lately? Doesn't look like we have hit this one for a while now. Did it disappear at the same time we bumped the disk size on the CI instances?

  7. tnozicka commented on Jan 31, 2018

    @tnozicka
    Contributor

    I haven't. @ironcladlou @mfojtik got any flakes looking like this? (Those are usually different tests as the detector is asynchronous and run for every deployment test.)

    Any chance that this might be related #18233?

  8. tnozicka commented on Feb 1, 2018

    @tnozicka
    Contributor
  9. sjenning commented on Feb 1, 2018

    @sjenning
    Contributor

    @tnozicka still trying to get to the root cause on this kubernetes/kubernetes#58711 (comment)

  10. sjenning commented on Feb 12, 2018

    @sjenning
    Contributor

    Opened a PR upstream:
    kubernetes/kubernetes#59767

  11. added a commit that references this issue on Feb 12, 2018
  12. smarterclayton commented on Feb 25, 2018

    @smarterclayton
    Contributor
  13. sjenning commented on Feb 27, 2018

    @sjenning
    Contributor

    It did go in about 2 weeks ago
    #18585

    Looking into it. If this is legitimately happening even with the check I added, I'm very confused.

  14. tnozicka commented on Mar 1, 2018

    @tnozicka
    Contributor

    I don't think the requested check in apiserver is present.

    To check, if I do

    curl -k -v -XPATCH -H "Authorization: Bearer ${TOKEN}" -H "Accept: application/json" -H "Content-Type: application/strategic-merge-patch+json" https://172.16.20.11:8443/api/v1/namespaces/test/pods/busyapp-76589968df-xnthx/status -d '{"status": {"phase": "Failed"}}'
    

    it gets overwritten back to Running.

    This is a serious bug and I feel we need that enforcement in the apiserver as well as the fix.

    It feels like the whole kubelet status manager ignores optimistic concurrency with resourceVersion and just does GET before updating the status no matter what resourceVersion was used for computing that status - the precondition might have changed in that case.

    pod, err := m.kubeClient.CoreV1().Pods(status.podNamespace).Get(status.podName, metav1.GetOptions{})
    if errors.IsNotFound(err) {
    glog.V(3).Infof("Pod %q (%s) does not exist on the server", status.podName, uid)
    // If the Pod is deleted the status will be cleared in
    // RemoveOrphanedStatuses, so we just ignore the update here.
    return
    }
    if err != nil {
    glog.Warningf("Failed to get status for pod %q: %v", format.PodDesc(status.podName, status.podNamespace, uid), err)
    return
    }
    translatedUID := m.podManager.TranslatePodUID(pod.UID)
    // Type convert original uid just for the purpose of comparison.
    if len(translatedUID) > 0 && translatedUID != kubetypes.ResolvedPodUID(uid) {
    glog.V(2).Infof("Pod %q was deleted and then recreated, skipping status update; old UID %q, new UID %q", format.Pod(pod), uid, translatedUID)
    m.deletePodStatus(uid)
    return
    }
    pod.Status = status.status
    // TODO: handle conflict as a retry, make that easier too.
    newPod, err := m.kubeClient.CoreV1().Pods(pod.Namespace).UpdateStatus(pod)
    if err != nil {
    glog.Warningf("Failed to update status for pod %q: %v", format.Pod(pod), err)
    return
    }

  15. sjenning commented on Mar 1, 2018

    @sjenning
    Contributor

    switching back to this issue

  16. sjenning commented on Mar 1, 2018

    @sjenning
    Contributor

    I swear, I'm losing it. I totally forgot that this PR got reopened and merged upstream kubernetes/kubernetes#54530. I'll pick it right now.

  17. added a commit that references this issue on Mar 4, 2018
    30679c7
  18. added a commit that references this issue on Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component/containerskind/test-flakepriority/P0sig/containerssig/master

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions