When worker stops due to an error the API will keep returning 202 rather than show an error. This means that the client will wait for execution in an infinite loop
Reproduce
one way to reproduce it is to programatically stop the pycrdt_websocket server:
[D 2024-08-27 09:36:09.061 ServerApp.jupyter_server_nb_model] Starting worker to process execution requests of kernel b9e05053-c3c9-4865-861f-77bac0f548c6…
[D 2024-08-27 09:36:09.061 ServerApp.jupyter_server_nb_model] Processing execution request a6f69c19-1435-4616-91d6-547e25c722d2 for kernel b9e05053-c3c9-4865-861f-77bac0f548c6…
[D 2024-08-27 09:36:09.061 ServerApp.jupyter_server_nb_model] a6f69c19-1435-4616-91d6-547e25c722d2 {'document_id': 'json:notebook:e70c9a57-dfa3-45ff-9509-88fccda8da2a', 'cell_id': '885916f4-16de-4c00-9873-56795ba1734f'}
[D 2024-08-27 09:36:09.061 ServerApp.jupyter_server_nb_model] Stopping execution requests worker for kernel b9e05053-c3c9-4865-861f-77bac0f548c6…
Traceback (most recent call last):
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_server_nbmodel/handlers.py", line 275, in _kernel_worker
results[uid] = await _execute_snippet(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_server_nbmodel/handlers.py", line 223, in _execute_snippet
ycell = await _get_ycell(ydoc, metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_server_nbmodel/handlers.py", line 101, in _get_ycell
notebook: YNotebook | None = await ydoc.get_document(room_id=document_id, copy=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_server_ydoc/app.py", line 170, in get_document
room = await self.ywebsocket_server.get_room(room_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/jupyter_server_ydoc/websocketserver.py", line 132, in get_room
await self.start_room(room)
File "/home/jupyter/notebook-env/lib/python3.11/site-packages/pycrdt_websocket/websocket_server.py", line 96, in start_room
raise RuntimeError(
RuntimeError: The WebsocketServer is not running: use `async with websocket_server:` or `await websocket_server.start()`
Description
When worker stops due to an error the API will keep returning 202 rather than show an error. This means that the client will wait for execution in an infinite loop
Reproduce
one way to reproduce it is to programatically stop the
pycrdt_websocket
server:Expected behavior
Error is propagated to the API