ipykernel icon indicating copy to clipboard operation
ipykernel copied to clipboard

Kernel shutdown and restart

Open davidbrochart opened this issue 4 years ago • 4 comments

It looks like sending a shutdown_request with content:

{
    "restart": true
}

doesn't restart the kernel, although it is specified in the kernel protocol.

davidbrochart avatar Jan 12 '22 09:01 davidbrochart

I can confirm this is the case.

ccordoba12 avatar Jan 12 '22 13:01 ccordoba12

If the kernel is able to shutdown and restart, the shutdown_reply must have a content of:

{
    "status": "ok",
    "restart": true
}

Then I think that ipykernel should reply with a status of "error", because it couldn't restart, so that the client is aware of it and can start the kernel manually as a fallback. But this is ambiguous because we don't know if the kernel did shutdown.

davidbrochart avatar Jan 12 '22 13:01 davidbrochart

Or maybe "restart": false in the reply could indicate that the kernel couldn't restart? The documentation is not very clear on this.

davidbrochart avatar Jan 12 '22 13:01 davidbrochart

I opened https://github.com/jupyter/jupyter_client/issues/736 to clarify the specification about this.

davidbrochart avatar Jan 13 '22 08:01 davidbrochart