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

POST /api/kernels/{kernel_id}/interrupt 500 Response. "Kernel is in a pending state. Cannot interrupt." #1247

Open
a3626a opened this issue Mar 27, 2023 · 2 comments
Labels

Comments

@a3626a
Copy link
Contributor

a3626a commented Mar 27, 2023

Description

During kernel resart, interrupting causes server side 500 error and client side Error: Unhandled Error

2023-03-27.15-27-56.mp4

Binder for the video: https://mybinder.org/v2/gh/binder-project/binder/HEAD
(well, it is easily reproducable widly)

Chrome console log:

react_devtools_backend.js:2655 Traceback (most recent call last):
  File "/home/leechanghwan/miniconda3/envs/jl3-ext/lib/python3.11/site-packages/tornado/web.py", line 1713, in _execute
    result = await result
             ^^^^^^^^^^^^
  File "/home/leechanghwan/miniconda3/envs/jl3-ext/lib/python3.11/site-packages/jupyter_server/services/kernels/handlers.py", line 94, in post
    await ensure_async(km.interrupt_kernel(kernel_id))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/leechanghwan/miniconda3/envs/jl3-ext/lib/python3.11/site-packages/jupyter_client/multikernelmanager.py", line 337, in interrupt_kernel
    raise RuntimeError("Kernel is in a pending state. Cannot interrupt.")
RuntimeError: Kernel is in a pending state. Cannot interrupt.

jlab_core.6144df8e3fe03e33f880.js?v=6144df8e3fe03e33f880:2 Uncaught (in promise) Error: Unhandled error
    at r.create (jlab_core.6144df8e3fe03e33f880.js?v=6144df8e3fe03e33f880:2:1029239)
    at async Object.c [as interruptKernel] (jlab_core.6144df8e3fe03e33f880.js?v=6144df8e3fe03e33f880:2:1017461)

Server responce:

{
  "message": "Unhandled error", 
  "reason": null,
  "traceback": "Traceback (most recent call last):\n  File \"/home/leechanghwan/miniconda3/envs/jl3-ext/lib/python3.11/site-packages/tornado/web.py\", line 1713, in _execute\n    result = await result\n             ^^^^^^^^^^^^\n  File \"/home/leechanghwan/miniconda3/envs/jl3-ext/lib/python3.11/site-packages/jupyter_server/services/kernels/handlers.py\", line 94, in post\n    await ensure_async(km.interrupt_kernel(kernel_id))\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/leechanghwan/miniconda3/envs/jl3-ext/lib/python3.11/site-packages/jupyter_client/multikernelmanager.py\", line 337, in interrupt_kernel\n    raise RuntimeError(\"Kernel is in a pending state. Cannot interrupt.\")\nRuntimeError: Kernel is in a pending state. Cannot interrupt.\n"
}

Reproduce

Check the video.
Tips:

  • click restart button and pop the dialog.
  • move user mouse pointer to 'stop' button
  • Press 'Enter' and click very fast and frequently

Expected behavior

Server might respond with error, but not 500. 4XX and with proper error message.

Context

Binder provided.

@a3626a a3626a added the bug label Mar 27, 2023
@welcome
Copy link

welcome bot commented Mar 27, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@darcsoel
Copy link

Which version of Python and Jupyter you are using? Is it reproducible with lower version?

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

No branches or pull requests

2 participants