Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
KernelManagers don't use zmq eventloop properly #967
The KernelManagers use sockets and tornado handlers directly via add/drop_io_state, thus essentially duplicating the ZMQStream objects that handle the state triggering, queuing, etc. already. Approximately all of the private methods on these channels are redundant with code already in ZMQStream.
Also, each channel should probably not be in a separate thread, they should share one ioloop instance between them, and it should be possible for this loop to be run in the main thread if so desired. The most apparent problem this causes (a minor one) is that stopping the channels can take a full second if there is no traffic on the network, which is a long time. I cannot think of any benefit to the channels running in their own threads, as they do now.
This is a low-ish priority, because the code we have works, but it should definitely be fixed.
I should also note that the polling logic in the HB channel is unnecessarily complicated, and actually wrong in some places. There is a comment interpreting