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

provide a way for kill(p) to kill the whole process group #18146

Closed
stevengj opened this issue Aug 19, 2016 · 4 comments
Closed

provide a way for kill(p) to kill the whole process group #18146

stevengj opened this issue Aug 19, 2016 · 4 comments
Labels
breaking This change will break code

Comments

@stevengj
Copy link
Member

stevengj commented Aug 19, 2016

Currently, kill(p) signals only a single process. However, spawn(detach(...)) creates a new process group, and killing the parent process does not necessarily kill the child processes.

I raninto this problem in IJulia, because on MacOS p = spawn(detach(ipython notebook)) spawns a bash script that in turn spawns the actual python server, and doing kill(p) only kills the parent bash process and not the underlying python server, which is then orphaned.

(In fact, I would have thought that the default of kill should have been to kill the whole process group.)

I don't see anything in libuv to provide this. I guess you would have to call getpgrp on the process id to get the group id to kill?

@StefanKarpinski StefanKarpinski added the breaking This change will break code label Aug 19, 2016
@StefanKarpinski StefanKarpinski added this to the 0.6.0 milestone Aug 19, 2016
@stevengj
Copy link
Member Author

Hmm, it seems like (a) the process group includes Julia itself (i.e. on Unix there isn't one process group created per spawnuv_spawn only calls setsid() before detaching a process) and (b) even killing Julia's process group doesn't kill ipython ... maybe ipython is doing something a bit odd?

So maybe there's not much we can do here, since the creation of process groups is under libuv's control?

@tkelman
Copy link
Contributor

tkelman commented Dec 29, 2016

feature freeze is soon and no one has started working on this, moving to 1.0

@tkelman tkelman modified the milestones: 1.0, 0.6.0 Dec 29, 2016
@stevengj stevengj removed this from the 1.0 milestone Dec 29, 2016
@stevengj
Copy link
Member Author

Not sure that this is even possible/desirable (see my comment above), so closing this unless the feature can be better defined.

@vtjnash
Copy link
Member

vtjnash commented Dec 30, 2016

Seems like you might be able to give it (juypter) a Pipe for it's STDIN, so that it will get a SIGPIPE when the parent (julia) died?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break code
Projects
None yet
Development

No branches or pull requests

4 participants