Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KernelManager.autorestart = False does not seem to work #94

Closed
minrk opened this issue Nov 25, 2015 · 2 comments · Fixed by #95
Closed

KernelManager.autorestart = False does not seem to work #94

minrk opened this issue Nov 25, 2015 · 2 comments · Fixed by #95
Milestone

Comments

@minrk
Copy link
Member

minrk commented Nov 25, 2015

@ghazpar opened ipython/ipython#9038

Hi,

I don't want the notebook server to automatically restart my kernels when they die. How can I achieve this? The config variable KernelManager.autorestart should fill my need, but does not seem to have any effect. BTW, the documentation says that the default value for this variable is False, but when I kill a kernel, it is always restarted automatically by the notebook server. I've tried to set the variable explicitly to False, but the behavior remains the same: my kernels get restarted automatically as soon as I kill them. Is this normal?

I need to be able to kill older kernels in order to free up memory. Using JupyterHub, I run many notebook servers for many users on the same machine, but my users often don't cleanup their kernels themselves. Any suggestions?

Many thanks in advance.

BTW, I run ipython 4.0.0.

@minrk
Copy link
Member Author

minrk commented Nov 26, 2015

@ghazpar commented

Digging into the source code (version 4.0.1), we found no trace of variable kernelManager.autorestart. However, we found variable KernelRestarter.restart_limit (default = 5) which when set to 0 does what we want, that is prevent any automatic kernel restart. The curious thing is that this variable does not appear in the command line --help-all options. Is the KernelRestarter class not included in the automatic parameter discovery mechanism?

So I guess it's the documentation that has fallen behind the implementation? Can a developer confirm that this is the correct way to go (changing the restart_limit)?

Thanks.

@minrk
Copy link
Member Author

minrk commented Nov 26, 2015

@minrk commented

  1. autorestart is hardcoded on instantiation of KernelManagers in MultiKernelManager, which takes higher priority than config, which makes it impossible to configure. I don't think there is a reason for this.
  2. in the meantime, you are correct that setting KernelRestarter.restart_limit = 0 does what you want, and is fine to set. The omission of KernelRestarter from the generated help is an oversight, but doesn't affect the fact that it can be configured, as you have found. Only that it's a lot more difficult to find that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant