[IPython-dev] iTorch - Weird issues with mkfifo on linux

Soumith Chintala soumith at fb.com
Thu Jan 15 22:26:58 EST 2015


Hey everyone,

As some of you might be aware, we released an ipython kernel for Lua (works only with LuaJIT because we use FFI for non-blocking reads). We also integrated visualization of images/video/audio and plotting using Bokeh.
https://github.com/facebook/iTorch

We use a two-process kernel, one of them handles stdout from the other process and sends it over to ipython. To pipe the processes, we use mkfifo, which is a posix utility.
http://pubs.opengroup.org/onlinepubs/009695399/functions/mkfifo.html

One problem we oncovered is that on certain (or possibly all linux distros) ipython thinks our kernel died, even though it is alive and well.
This only happen if we use mkfifo to redirect the output stream from one process to another. If we use a standard file like with this commit:
https://github.com/soumith/iTorch/commit/96e8a26a91a90d47583761a55b308364d391585c
we do not see any issues.

I am trying to understand Ipython semantics for thinking that a kernel died, as the heartbeat is still ticking.
I initially thought a SIGPIPE might be triggering Ipython to think that the kernel died, but I am not sure of that. I tried to set a trap here: https://github.com/soumith/iTorch/blob/master/itorch#L7 for SIGPIPE so that before the launch of ipython, SIGPIPE is trapped completely. However that did not help the “kernel died” message.

The "kernel died” message appears when the first execute_request is processed, not before that.

Do let me know if you have any pointers.

Thanks,
Soumith


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150116/ca6d322d/attachment.html>


More information about the IPython-dev mailing list