jupyter_client
jupyter_client copied to clipboard
`restart=True` is never passed to `provisioner.terminate`
Hi, I am working on a provisioner for remote kernels via SSH (https://github.com/caenrigen/sshpyk/tree/provisioner).
I noticed that my provisioner's async def terminate(self, restart: bool = False) never receives a restart=True value even if I restart the kernel (in JupyterLab).
From inspecting jupyter_client this happens because async def _async_send_kernel_sigterm(self, restart: bool = False) is never being passed the restart argument at all (and it defaults always to False from default python args):
https://github.com/jupyter/jupyter_client/blob/6ea834d69d9404b9b67fbc066ee8bdf1d7d2ede6/jupyter_client/manager.py#L480
Is this a bug or intended behaviour? Would you accept a PR if it is a bug? though I probably have to implement a workaround anyway for some backwards compatibility with previous version of jupyter_client, I think I should be able to by caching the restart argument passed to provisioner.shutdown_requested.
As a side note I also notice that _async_kill_kernel does not always receive the argument either, intended?
https://github.com/jupyter/jupyter_client/blob/6ea834d69d9404b9b67fbc066ee8bdf1d7d2ede6/jupyter_client/manager.py#L545