{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21008","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21008/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21008/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21008/events","html_url":"https://github.com/kubernetes/kubernetes/issues/21008","id":132847294,"number":21008,"title":"CrashBackOffLoop despite clean exit?","user":{"login":"dlitwin-autodesk","id":16021830,"avatar_url":"https://avatars.githubusercontent.com/u/16021830?v=3","gravatar_id":"","url":"https://api.github.com/users/dlitwin-autodesk","html_url":"https://github.com/dlitwin-autodesk","followers_url":"https://api.github.com/users/dlitwin-autodesk/followers","following_url":"https://api.github.com/users/dlitwin-autodesk/following{/other_user}","gists_url":"https://api.github.com/users/dlitwin-autodesk/gists{/gist_id}","starred_url":"https://api.github.com/users/dlitwin-autodesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlitwin-autodesk/subscriptions","organizations_url":"https://api.github.com/users/dlitwin-autodesk/orgs","repos_url":"https://api.github.com/users/dlitwin-autodesk/repos","events_url":"https://api.github.com/users/dlitwin-autodesk/events{/privacy}","received_events_url":"https://api.github.com/users/dlitwin-autodesk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-10T23:23:30Z","updated_at":"2016-02-10T23:33:15Z","closed_at":null,"body":"I have a service I would like to update from time to time.\r\nI have it perform a clean exit periodically, relying on the replication controller to start up a fresh service in its place.\r\nAlthough I am careful to exit with an exit status of zero, the second instance to exit triggers the service into the CrashBackOffLoop status and my restart is delayed.\r\n\r\nFrom what I can see here:\r\nhttps://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/dockertools/manager.go#L1931\r\nthe back off code doesn't consider the exit status at all, just the duration between exits when setting the service into what is described as a crash, although no crash is happening.\r\nShould it not also check for containerStatus.ExitCode != 0 ?"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/182635330","html_url":"https://github.com/kubernetes/kubernetes/issues/21008#issuecomment-182635330","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21008","id":182635330,"user":{"login":"Random-Liu","id":5821883,"avatar_url":"https://avatars.githubusercontent.com/u/5821883?v=3","gravatar_id":"","url":"https://api.github.com/users/Random-Liu","html_url":"https://github.com/Random-Liu","followers_url":"https://api.github.com/users/Random-Liu/followers","following_url":"https://api.github.com/users/Random-Liu/following{/other_user}","gists_url":"https://api.github.com/users/Random-Liu/gists{/gist_id}","starred_url":"https://api.github.com/users/Random-Liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Random-Liu/subscriptions","organizations_url":"https://api.github.com/users/Random-Liu/orgs","repos_url":"https://api.github.com/users/Random-Liu/repos","events_url":"https://api.github.com/users/Random-Liu/events{/privacy}","received_events_url":"https://api.github.com/users/Random-Liu/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T23:33:15Z","updated_at":"2016-02-10T23:33:15Z","body":"The `ExitCode` is considered in [`ShouldContainerBeRestarted()`](https://github.com/kubernetes/kubernetes/blob/71bcc25409cc284c874cd31b52371b0d4d81fbf0/pkg/kubelet/container/helpers.go#L48).\r\n\r\nMoreover, how did you configure the [`RestartPolicy`](http://kubernetes.io/v1.1/docs/user-guide/replication-controller.html)? I think for your case `RestartPolicyOnFailure` may be what you want."}}