Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Solves hanging indefinitely when kernel dies #959
I use Jupyter notebooks for automatic regression testing. I use nbconvert to execute notebooks containing tests:
In one of the tests the kernel dies. Unfortunately nbconvert will hang on this. I can't use timeouts as some cells in the test notebooks take a long time to execute. If the kernel dies I want nbconvert to detect this almost immediately.
The patch checks that the kernel is alive while waiting for a message.
Thanks for submitting this -- I was planning on tackling it soon as well (see nteract/papermill#125). I've started seeing this error message occasionally during tests with papermill and nbconvert and will take a look if I can figure out why. I'll do a more thorough testing for this PR before merging as it's really critical that this operate correctly for papermill.
I dug through all of the client code and this reads as the correct fix for the issue.
I will say though that given how critical this piece section of code is for the library it should have a unittest for each branch possible here. This area may be undertested today as well. If you can add unittests for this pattern I'm willing to go dig deeper in to the unrelated build failure and trace back what's causing that.
I will be out of town for a bit, so might be slow on responding to this thread. But when I get back I'll want to get this and a few other changes merged for a new release.