<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hey everyone,</div>
<div><br>
</div>
<div>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.</div>
<div><a href="https://github.com/facebook/iTorch">https://github.com/facebook/iTorch</a></div>
<div><br>
</div>
<div>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. </div>
<div><a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/mkfifo.html">http://pubs.opengroup.org/onlinepubs/009695399/functions/mkfifo.html</a></div>
<div><br>
</div>
<div>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.</div>
<div>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:</div>
<div><a href="https://github.com/soumith/iTorch/commit/96e8a26a91a90d47583761a55b308364d391585c">https://github.com/soumith/iTorch/commit/96e8a26a91a90d47583761a55b308364d391585c</a></div>
<div>we do not see any issues.</div>
<div><br>
</div>
<div>I am trying to understand Ipython semantics for thinking that a kernel died, as the heartbeat is still ticking.</div>
<div>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: <a href="https://github.com/soumith/iTorch/blob/master/itorch#L7">https://github.com/soumith/iTorch/blob/master/itorch#L7</a> for
 SIGPIPE so that before the launch of ipython, SIGPIPE is trapped completely. However that did not help the “kernel died” message.</div>
<div><br>
</div>
<div>The "kernel died” message appears when the first execute_request is processed, not before that.</div>
<div><br>
</div>
<div>Do let me know if you have any pointers.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Soumith</div>
<div><br>
</div>
<br>
</body>
</html>