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

fix qtconsole support #19

Closed
stevengj opened this issue Jul 27, 2013 · 8 comments
Closed

fix qtconsole support #19

stevengj opened this issue Jul 27, 2013 · 8 comments
Labels

Comments

@stevengj
Copy link
Member

Currently, if you try to connect to a qtconsole, the kernel hangs while waiting for the first message (normally, it gets an execute_request right away).

Specifically, it gets the identity header of the first message, and ZMQ indicates that more is to come, but then the next recv hangs (which @minrk says should not be possible if ZMQ said there was more of the message).

This could be a bug in our ZMQ wrappers, possibly with the asynchronous stuff that @loladiro recently added. ping @aviks.

@Keno
Copy link
Member

Keno commented Jul 27, 2013

The way I'm determining whether or not we can read a message is to query the socket for POLLIN, does ZMQ have a different status to indicate that there a partial message still pending?

@minrk
Copy link
Contributor

minrk commented Jul 27, 2013

ZeroMQ should never report a partial message - multipart messages are sent and received atomically (where by message I mean a sequence of zmq_mst_t frames associated by ZMQ_MORE/RCVMORE/SNDMORE). That is, if getsockopt(socket, ZMQ_RCVMORE) gives True (and the returncode is zero indicating a successful call), the next zmq_msg_recv(socket) is guaranteed not to block. If this condition is indeed being violated, there is a serious bug in zeromq, but that would surprise me.

@Keno
Copy link
Member

Keno commented Jul 27, 2013

Alright, I adjusted ZMQ.jl, @stevengj I have verified that this works for me with qtconsole (at least past where it used to hang).

@stevengj
Copy link
Member Author

Okay, it gets farther now. After commit f1da940 (adding the missing history_request), qtconsole successfully starts and evaluates Julia expressions. Remaining problems:

  • The --profile option doesn't work, because qtconsole doesn't know how to start the Julia kernel (probably @StefanKarpinski needs to patch it similar to how he patched the notebook). You have to start the Julia kernel and then connect a qtconsole to it with the --existing option.
  • Input is received and computed, and a pyout message is sent, but qtconsole is not displaying any output (there are no Out lines). Not sure what is going on here.

@Carreau
Copy link
Contributor

Carreau commented Jul 27, 2013

You shouldn't need to patch, try if the following works :

ipython qtconsole --KernelManager.kernel_cmd='["julia", "kernel.jl", "{connection_file}"]'

if it does then it means you shoudl also set c.KernelManager.kernel_cmd='["ruby", "lib/kernel.rb", "{connection_file}"]' in qtconsole config file.

@Carreau
Copy link
Contributor

Carreau commented Jul 27, 2013

... file that would be ipython_qtconsole_config.py, probably in .ipyton/profile_julia. alternatively you shoudl be able to set c.KernelManager.kernel_cmd=... in ipython_config.py that should apply to both qtconsole and notebook.

IIRC config take precedence in this order : command line flag > --config=configfile > ipython_config_(qtconsole|notebook) > ipython_config.py> hardcoded defaults. Does it makes sens ?

@stevengj
Copy link
Member Author

Thanks, adding

c.KernelManager.kernel_cmd = ["julia", "/....path..../julia-ipython/jlkernel/kernel.jl", "{connection_file}"]

fixed the --profile for me; I didn't realize that I had only added this to ipython_notebook_config.py

@stevengj
Copy link
Member Author

Okay, basic qtconsole functionality seems to work now. (qtconsole expected an (undocumented) metadata field in pyout messages).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants