[IPython-dev] interrupting local kernels

MinRK benjaminrk at gmail.com
Fri Feb 24 13:58:51 EST 2012

The nanny process is ultimately  the way we need to go, otherwise you won't
ever be able to interrupt remote kernels.

On Thu, Feb 23, 2012 at 23:04, Matt Terry <matt.terry at gmail.com> wrote:

> I want to be able to interrupt an ipython kernel that is local to my
> machine, but not owned by the current process.  I recognize that the
> general problem of interrupting a truly remote kernel is a harder
> problem and i'm not explicitly not addressing that.  However, I think
> interrupting a local kernel is worth having a special case.
> All you need to interrupt a local kernel is its pid, so you can send a
> SIGINT to the appropriate process.  The only way I can think of to get
> that information is to ask the remote kernel (over the shell channel)
> to return the output of "os.getpid()".  The kernel might restart and
> change pid, so you'd have to poll.  This seems ugly and failure prone.
> What you need is
> A) the kernel to have a nanny that always knows what the kernel's pid is
> or
> B) the kernel to communicate its pid someway other than over the shell
> channel
> What about using the heartbeat channel to echo the pid?  To my
> understanding, the heart beats even if the kernel is chugging away.
> We could have the heartbeat channel return the pid instead of the
> uuid, or we could return them both.  Alternatively, we could pid
> information in a file in .ipython/somewhere, but that seems
> potentially contentious.
> -matt
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20120224/581bf8f2/attachment.html>

More information about the IPython-dev mailing list