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

Limit cell execution time #11483

Open
katsar0v opened this issue Nov 6, 2018 · 1 comment
Open

Limit cell execution time #11483

katsar0v opened this issue Nov 6, 2018 · 1 comment

Comments

@katsar0v
Copy link

katsar0v commented Nov 6, 2018

Hello guys,

is there a way to limit the maximum time a cell can be executed? I am doing this currently with MappingKernelManager, but there are some side-effects. My config:

c.MappingKernelManager.cull_busy = True
c.MappingKernelManager.cull_connected = True
c.MappingKernelManager.cull_idle_timeout = 300
c.MappingKernelManager.cull_interval = 30

Side-effect 1:

  • After 6 minutes, the kernel of the user is randomly culled. I know this is intended by the config.

My intention is to prevent endless loop and long code from executing, e.g.

while True:
    a = 1
@Carreau
Copy link
Member

Carreau commented Nov 6, 2018

It's not particularly possible natively. You could likely implement that to send a Sigint if the kernel is busy for more than x-time, but it would need to be implemented in the kernel manager.

This is likely something that you want to ask on jupyter/notebook, and not ipython/ipython.

It may also be implementable purely as a javascript extension that watch for the kernel idle and busy messages.

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

No branches or pull requests

2 participants