8.x timeout bug
mlucool opened this issue · 2 comments
When upgrading to 7.4.9 to 8.1.0, the timeout parameter no longer works with papermill + a custom KernelManager
.
Example notebook, example_slow.ipynb
:
from time import sleep
sleep(10)
Executing with papermill:
import papermill as pm
pm.execute_notebook("example_slow.ipynb", "example_slow.out.ipynb", timeout=1, kernel_manager_class="jupyter_client.manager.KernelManager")
With 7.4.9 this correctly raises CellTimeoutError
. With 8.1.0 the notebook runs to completion (in 10 seconds). Oddly, if I don't use a custom manager class, it also errors correctly. I need a custom manager given #154 (comment).
Is this a bug in this package or should how timeout is used be changed in papermill?
It seems to me that jupyter_client>=8
breaks some assumptions that nbclient
made, so this is not necessarily a bug with jupyter_client
.
Edit: How about using jupyter_client.manager.AsyncKernelManager
?
This seems to work, and solves my use case. I'll close this, but I'm not sure if others feel there is still a bug here. If so, please reopen.