Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill child process before task process. #980

Closed
wants to merge 1 commit into from

Conversation

ArthurJam
Copy link

When you killed a task, you first closed the task before killing its children and therefore their were not closed.
Now I act in the other way, by killing the children before.

When you killed a task, you first closed the task before killing its children and therefore their were not closed.
Now I act in the other way, by killing the children before.
@Novik
Copy link
Owner

Novik commented Dec 22, 2014

Sorry, but i think this is non-sense. In *nix you can kill parent without it's children. And all will be ok, parent process will be killed, but children still alive (and you can kill its next).
You can check this by simply way - https://stackoverflow.com/questions/8533377/why-child-process-still-alive-after-parent-process-was-killed-in-linux

@ArthurJam
Copy link
Author

Hi,

Actually the command to kill a task is in 3 steps :
1 Kill the parent process (kill -9 pid)
2 Get the children process from parent (pgrep pid)
3 Kill children process kill -9 pgrep pid

But in practice (in my platform), the children are not killed by this processus.
I think you cant pgrep a pid are already killed, so you can't get the children process list (Unless the first kill command takes a certain delay).

So, i propose to inverse the scenario.

Novik added a commit that referenced this pull request Jan 16, 2015
@Novik
Copy link
Owner

Novik commented Jan 16, 2015

OK, thanks, i change order of kill requests.

@Novik Novik closed this Feb 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants