gregsexton / gregsexton/ob-ipython

client.py deadlocks on BlockingKernelClient.get_iopub_msg()

Open
#164 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
742
Forks
107
PR merge metrics
No merged PRs in 30d

Description

It seems client.py sometimes deadlocks waiting on the lost messages for IOPub channel.

The IPython doc[1] says that IOPub is a "broadcast channel" which I think implies that there will be no guarantee that the messages get actually delivered to client.py, and indeed they get quite often lost in my setup ([Emacs on macbook] <=[ssh tunnel]=> [IPython kernel on a VM instance in the GCP cloud])

A quickest hack to work around the deadlocks would be to change the first "while True:" to "while False:", in the function msg_router, at the cost of losing all the stdout/stderr outputs. But at least this gets the code executed without blocking indefinitely, and we have historical data of stdout/stderr available any time from the shell channel.

I guess the correct solution would be to regard any message from IOPub as a bonus that could get lost at any time, and only wait for history data from the shell channel.

[1]: https://ipython.org/ipython-doc/3/development/messaging.html

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.