Skip to content

Websocket subprotocol checked before the connection is established. #705

Closed
@Zsailer

Description

@Zsailer

I'm seeing the following issue when launching (pending) kernels after #657

[E 2022-03-01 22:26:12.490 ServerApp] Uncaught exception in ZMQStream callback
    Traceback (most recent call last):
      File "/<user_path>/python3.8/site-packages/zmq/eventloop/zmqstream.py", line 431, in _run_callback
        callback(*args, **kwargs)
      File "/<user_path>/python3.8/site-packages/zmq/eventloop/zmqstream.py", line 189, in <lambda>
        self.on_recv(lambda msg: callback(self, msg), copy=copy)
      File "/<user_path>/python3.8/site-packages/jupyter_server/services/kernels/handlers.py", line 518, in _on_zmq_reply
        if self.selected_subprotocol == "v1.kernel.websocket.jupyter.org":
      File "/<user_path>/python3.8/site-packages/tornado/websocket.py", line 373, in selected_subprotocol
        assert self.ws_connection is not None
    AssertionError
[E 2022-03-01 22:26:12.491 ServerApp] Uncaught exception in zmqstream callback

It seems that ws_connection is not necessarily set before selected_subprotocol is checked in the _on_zmq_reply method.

Pinging @davidbrochart, in case you have any insights. I'll take a closer look later this week too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions