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

Infinite loop with print crashes jupyter lab browser UI #160

Open
lsignac opened this issue Nov 22, 2024 · 3 comments
Open

Infinite loop with print crashes jupyter lab browser UI #160

lsignac opened this issue Nov 22, 2024 · 3 comments

Comments

@lsignac
Copy link

lsignac commented Nov 22, 2024

Not sure... but it seems to me that last year, an infinite loop like this :

whie True:
    print("OK")

used to "raise" this error (not a Python exception, a notebook error) :

IOPub data rate exceeded.
The notebook server will temporarily stop sending output
to the client in order to avoid crashing it.

With the new jupyterlab version available on nbhosting, there is no such error, and the ui freezes before anyone hits the stop button of the UI. This is not a nnbhosting, but a jupyter issue and may be it is related to this issue : jupyter/notebook#2364
Also, may be setting --NotebookApp.iopub_data_rate_limit could prevent the browser from freezing ?

@parmentelat
Copy link
Owner

hey
the issue you are referring to is about the classic notebook - plus, it's 7 years old
so I don't believe it is relevant...

regardless; I suggest you try this on your end on a regular jupyter lab so that you can freely play with any setting, and once you have a definite answer I can adapt nbhosting
another option of course would be to allow users to set their own setting somehow; however this seems a little overkill at this point I believe, what do you think ?

@lsignac
Copy link
Author

lsignac commented Nov 22, 2024

I ask students to be more careful with infinite loops :).
I will try settings on my local installation and if an interesting setting appears, I will tell you.

@lsignac
Copy link
Author

lsignac commented Nov 27, 2024

On my own jupyter lab, the default value for data rate is OK (1 000 000 bytes / sec):

image

On jupyterlab's nbhosting, the behaviour is different :
image

With my students, I use the nbhosting classic notebook interface. The same :
image

Without the rate limitation, an infinite loop with a print inside makes the browser freeze, and it's sometimes impossible to press the STOP button.

Is it possible to set or lower the max data rate ?

On my own machine, I can change the jupyter lab max data rate this way :

jupyter lab --ServerApp.iopub_data_rate_limit=1000000

May be (not tested), for nbhosting classic notebook, it's :

jupyter notebook --NotebookApp.iopub_data_rate_limit=1000000

Thanks.

PS : My jupyter lab version : 4.3.1

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