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

Notebooks don't correctly update the status of input cells #1417

Open
vaibhavsagar opened this issue Sep 7, 2023 · 3 comments
Open

Notebooks don't correctly update the status of input cells #1417

vaibhavsagar opened this issue Sep 7, 2023 · 3 comments

Comments

@vaibhavsagar
Copy link
Member

vaibhavsagar commented Sep 7, 2023

Recently I've noticed that when using jupyter notebook, input cells don't update their status to reflect that they have been executed until a subsequent cell is run:

cell_status_not_updating

I think this might be due to a change in jupyter_client or the messaging protocol.

(Tested with nixpkgs commit a16f7eb56e88c8985fcc6eb81dabd6cade4e425a)

@vaibhavsagar
Copy link
Member Author

I thought it might be because we send display_data messages instead of execute_result messages like the IPython kernel does.

Here's some debug output for the above notebook with Haskell:

$ jupyter notebook --debug
<...>
[D 21:08:52.420 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: status (busy)
[D 21:08:52.436 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: execute_input
[D 21:08:53.905 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: display_data
[D 21:08:54.126 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: clear_output
[D 21:08:54.128 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: display_data
[D 21:08:54.286 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: status (idle)
[D 21:08:54.288 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: status (busy)
[D 21:08:54.292 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: execute_input
[D 21:08:54.522 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: display_data
[D 21:08:54.686 NotebookApp] activity on ee491879-4a78-4b75-812b-4c45e58c70eb: status (idle)

And with Python:

[D 21:09:55.681 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: status (busy)
[D 21:09:55.684 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: status (idle)
[D 21:10:50.295 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: status (busy)
[D 21:10:50.311 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: execute_input
[D 21:10:50.335 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: execute_result
[D 21:10:50.345 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: status (idle)
[D 21:10:55.201 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: status (busy)
[D 21:10:55.205 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: execute_input
[D 21:10:55.215 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: execute_result
[D 21:10:55.225 NotebookApp] activity on 95f42d41-976b-45fc-b6de-ac4997c6f05e: status (idle)

However, I made a branch commit (2537124) to send execute_result messages instead of display_data and it seemed to have the same issue:

[D 21:15:12.134 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: status (idle)
[D 21:15:12.136 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: status (idle)
[D 21:15:14.543 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: status (busy)
[D 21:15:14.546 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: execute_input
[D 21:15:15.748 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: execute_result
[D 21:15:15.901 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: status (idle)
[D 21:15:18.702 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: status (busy)
[D 21:15:18.705 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: execute_input
[D 21:15:18.889 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: execute_result
[D 21:15:19.035 NotebookApp] activity on 7fb18411-1001-446f-8812-0996ecf5caab: status (idle)

so I don't think that this is the reason.

@jamesdbrock
Copy link
Member

Oh yeah I've seen that too. I opened an issue with JupyterLab jupyterlab/jupyterlab#13383

But you're seeing it on classic Jupyter so you're probably right that the problem is in jupyter_client or somewhere else.

@vaibhavsagar
Copy link
Member Author

Ah interesting, thanks for investigating this!

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