Bug 1321298

Summary: Pod restart times should always be 0 when restart policy set Never
Product: OpenShift Container Platform Reporter: Weihua Meng <wmeng>
Component: NodeAssignee: Seth Jennings <sjenning>
Status: CLOSED NOTABUG QA Contact: Xiaoli Tian <xtian>
Severity: low Docs Contact:
Priority: low    
Version: 3.2.0CC: aos-bugs, decarr, gblomqui, jchaloup, jokerman, mmccomas, pmorie
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-03 15:20:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Weihua Meng 2016-03-25 09:56:44 UTC
Description of problem:
Pod restart times should not be 1 when restart policy set Never

Version-Release number of selected component (if applicable):
openshift v3.2.0.7
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5


How reproducible:
sometimes

Steps to Reproduce:
1.create a job with restartpolicy set Never
cat job.yaml
apiVersion: extensions/v1beta1
kind: Job
metadata:
  name: pi
spec:
  selector:
    matchLabels:
      app: pi
  template:
    metadata:
      name: pi
      labels:
        app: pi
    spec:
      containers:
      - name: pi
        image: perl
        command: ["peeerl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
      restartPolicy: Never
2.wait a couple of minutes and check pod status


Actual results:
2. Some pod's "restarts" is 1
[root@dhcp-128-70         test]# oc get job
NAME      DESIRED           SUCCESSFUL   AGE
pi        1                 0            18m
[root@dhcp-128-70         test]# oc get po
NAME       READY             STATUS               RESTARTS   AGE
pi-0c46g   0/1               RunContainerError    1          17m
pi-128tf   0/1               ContainerCannotRun   1          14m
pi-1cqc2   0/1               RunContainerError    1          15m
pi-22q0t   0/1               RunContainerError    1          16m
pi-25d3u   0/1               RunContainerError    1          6m
pi-2l0u2   0/1               RunContainerError    1          7m
pi-3z4nh   0/1               ContainerCannotRun   0          18m
pi-4e7l7   0/1               RunContainerError    1          7m
pi-4vnzk   0/1               ContainerCannotRun   1          11m
pi-6oz6m   0/1               ContainerCannotRun   0          17m
pi-7jcyj   0/1               ContainerCannotRun   0          15m
pi-8four   0/1               ContainerCannotRun   0          9m
pi-8kr6i   0/1               ContainerCannotRun   0          8m
pi-97utk   0/1               ContainerCannotRun   0          17m
pi-9ksgv   0/1               ContainerCannotRun   0          5m
pi-9zqew   0/1               ContainerCannotRun   1          14m
pi-a2qpo   0/1               RunContainerError    1          8m
pi-a53jb   0/1               ContainerCannotRun   0          15m
pi-acz4r   0/1               ContainerCreating    0          9s
pi-afz6p   0/1               ContainerCannotRun   0          11m
pi-b7xj3   0/1               RunContainerError    1          3m
pi-bjstl   0/1               ContainerCannotRun   0          13m

Expected results:
2. The "restarts" of all the pod should be 0

Additional info:

Comment 1 DeShuai Ma 2016-03-25 10:24:39 UTC
Before bugs https://bugzilla.redhat.com/show_bug.cgi?id=1262753
I also test on another env, job create 100 pods about 5 pods's "RESTARTS" is 1, others is 0.

Comment 2 Andy Goldstein 2016-03-25 11:08:12 UTC
Paul/Derek/Jan, FYI, something to investigate...

Comment 3 Avesh Agarwal 2016-03-28 14:21:59 UTC
I am able to reproduce this:

oc get pods
NAME       READY     STATUS               RESTARTS   AGE
pi-3jhoj   0/1       RunContainerError    0          4s
pi-bz67r   0/1       RunContainerError    1          1m
pi-dcwcx   0/1       RunContainerError    1          28s
pi-ri0sr   0/1       ContainerCannotRun   0          8s

Comment 4 Derek Carr 2016-03-29 14:43:32 UTC
I will look into the core kubelet code and report back today.

Comment 5 Derek Carr 2016-03-29 14:46:07 UTC
Moved back to Avesh, sorry for my confusion.

Comment 6 Andy Goldstein 2016-03-30 19:27:42 UTC
https://github.com/kubernetes/kubernetes/issues/23636

Comment 7 Avesh Agarwal 2016-06-28 13:24:34 UTC
Based on the discussion in https://github.com/kubernetes/kubernetes/issues/23636, I am going to lower its priority. Please let me know if there is any disagreement and we can discuss further.

Comment 10 Greg Blomquist 2019-07-03 15:20:54 UTC
No activity in 4 years