-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
raw_input appears to be round-robin for qtconsole #673
Comments
Good catch. The stdin socket is definitely the wrong type. We need to do one of the following:
what currently happens with multiple frontends is entirely nonsensical: stdin requests are LRU load-balanced across frontends. |
Yup, you caught this :) Thanks for making a proper report for it, we really need to fix this to have real use of multi-client scenarios. |
There are actually several more than the 2 options I proposed, but all would require some amount of handshaking to be added to frontends connecting to the kernel. The one we use now (and #2 above) is probably the worst, since a malicious/accidental connection to the stdin socket would cause this problem in a way the kernel has no way of preventing. More could be: I think 1. and 3. are the best choices, depending on whether we want to bind the stdin request to the caller who caused it in the first place, or let any frontend respond (more flexible, but potentially weird side effects). |
stdin requests are now directed to the frontend that made the execution request that called raw_input. allow_stdin flag added to execution_request to indicate whether stdin_requests are allowed. StdInNotImplementedError exception class added to IPython.core.error, and is raised if raw_input is called from execute requests where allow_input is undefined. closes ipythongh-673
Changes stdin channel from REQ-REQ to ROUTER-DEALER, fixing the round-robin load-balancing of stdin_requests across frontends. stdin_requests now go to the client that made the execute_request that prompted the stdin request. stdin_requests from frontends that do not support stdin will raise an error, rather than hanging on input that will never arrive. reviewed by @fperez closes ipython#673
If I start a qtconsole, raw_input() seems to just work. But when I hook up to it from another kernel manager, then raw_input() only responds from qt_console every other time and blocks the other time, and if I attach a 3rd kernel manager, it only responds every 3rd time.
sending stdin_channel.input() from the 2nd and 3rd kernelmanagers always works, regardless of whether or not qtconsole is blocking or properly handling the raw_input.
The text was updated successfully, but these errors were encountered: