Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

Conversation

iaguis
Copy link
Member

@iaguis iaguis commented Sep 18, 2017

The kubelet tries to remove apps from pods that are stopped and there's
no reason to prevent the removal of apps from not running pods, actually
it was considered in some parts of stage0.RmApp().

Let's not require pods to be running to remove apps. If the pod is
running, we'll still stop the app units and so on. If not, we just
remove the app.

The kubelet tries to remove apps from pods that are stopped and there's
no reason to prevent the removal of apps from not running pods, actually
it was considered in some parts of stage0.RmApp().

Let's not require pods to be running to remove apps. If the pod is
running, we'll still stop the app units and so on. If not, we just
remove the app.
stderr.PrintE(fmt.Sprintf("unable to determine the pid for pod %q", p.UUID), err)
return 254
var podPID int
if p.State() == pkgPod.Running {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this. If you are removing an app from a stopped pod, it means it previously reached both pid-file writing and supervisor-ready file writing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using podPID == 0 to mean the pod is not running and hence we don't need to call the stop and rm entrypoints. I guess I was confused by the comment in

// Call app-stop and app-rm entrypoint only if the pod is still running.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which is actually partially true if we use ppid because we'll then try to find the pid by calling getChildPID which looks in /proc/PPID/task/PPID/children or over /proc. So it will return a -1.

However, when we use pid (KVM flavor), the file will be present and have a > 0 value.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could move this test to stage0.RmApp to decide whether to call the entrypoints or not.

Copy link
Member Author

@iaguis iaguis Sep 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a p.isRunning() inside p.ContainerPid1(). I think I'd rather leave this like it is now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, I'm fine with that, and thanks for the additional info.

@squeed
Copy link
Contributor

squeed commented Sep 20, 2017

Part of me wonders if removing an app from a stopped pod should be a no-op. However, I bet the kubelet will keep trying to remove the app over-and-over, so I suspect it's needed.

Copy link
Member

@lucab lucab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iaguis
Copy link
Member Author

iaguis commented Sep 21, 2017

Thanks!

@iaguis iaguis merged commit d7226ee into rkt:master Sep 21, 2017
@iaguis iaguis deleted the iaguis/stopped-app-rm branch January 9, 2018 12:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants