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
Multiprocessing in ipython notebook kernel crash #2422
Comments
seem to be |
hum, strange, that what git bisect told me... I might have type |
I am running pyzmq 2.2.0.1 and python 2.7.3. @minrk If it isn't an ipython bug then why does it break when I switch between master and the 13.1 branch? |
My apologies - there is something IPython related going on here, I didn't notice the print statement. The issue is that zmq sockets cannot be passed across a fork, and sys.stdout is linked to a zmq socket. IPython is going to need to detect forks and discard (and possibly recreate) sockets when a fork happens. I don't know how the crash occurs in the parent process in master, that's super weird. I would expect the child to crash, though. |
It seems that the child does crash. So is there a way to fork processes from running notebooks/engines? I would like to fork a process from a notebook/engine so that the notebook/engine itself can act as a stable interface to a data acquisition process. |
The commit where the behavior changed is 2aee9e3, which has the effect of changing small messages to not use zero-copy. So I suspect the difference is that the state of zmq buffers is different when fork is called in master. In any case, if IPython detects a fork and avoids re-using the sockets the crash should be avoided. I would consider it an anomaly that 0.13 does not crash in this case. |
Yeah after further testing it also crashes the ipython kernel in 0.13 some of the time. I guess I'll have to customize an ipython engine instance to do what I want. |
For reference, the issue is specifically with the print statement. You should have no issue if you can avoid writing to stdout, or redirect stdout/err back to |
Looks like this bug should be re-opened, and #2438 be closed as a duplicate, no? |
It doesn't matter which one is kept open, but #2438 has a more precise description of the actual issue. |
The simple script:
Works fine in an ipython notebook in 0.13 but crashes the kernel in the head branch. The kernel spits out a ZMQ error: Assertion failed: ok (mailbox.cpp:84).
The text was updated successfully, but these errors were encountered: