jupyter / jupyter/notebook

JupyterLab with notebook 5.7.8 and tornado 6

Open
#4,549 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

This issue is to track issues with the recent tornado 6 update. It's corresponding issue in lab is jupyterlab/jupyterlab#6131. Our tests are currently failing on kernel restarts with errors like

    HTTPServerRequest(protocol='http', host='localhost:8889', method='GET', uri='/api/kernels/bb699f4d-dd2a-417c-8883-a0adba0a43da/channels?session_id=081a2738-da46-46db-b556-c8de0d7b0dff&token=5ad5f308acfdba227495ff408b73f8ac98fb64fa99ec9ce8', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
        result = await result
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/notebook/services/kernels/handlers.py", line 241, in get
        yield super(ZMQChannelsHandler, self).get(kernel_id=kernel_id)
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
        value = future.result()
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/notebook/base/zmqhandlers.py", line 297, in get
        yield gen.maybe_future(res)
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
        value = future.result()
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/websocket.py", line 278, in get
        await self.ws_connection.accept_connection(self)
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/websocket.py", line 881, in accept_connection
        await self._accept_connection(handler)
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/websocket.py", line 964, in _accept_connection
        await self._receive_frame_loop()
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/websocket.py", line 1118, in _receive_frame_loop
        await self._receive_frame()
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/websocket.py", line 1130, in _receive_frame
        data = await self._read_bytes(2)
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/websocket.py", line 1124, in _read_bytes
        data = await self.stream.read_bytes(n)
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/iostream.py", line 436, in read_bytes
        future = self._start_read()
      File "/home/ian/anaconda3/envs/test-tornado/lib/python3.7/site-packages/tornado/iostream.py", line 797, in _start_read
        assert self._read_future is None, "Already reading"

A fix was made in #4513, but we are still seeing these issues. This may also be related to issues that mybinder has been having with lab binders (cc @betatim).

xrefs #4439 #4412

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the kernel-restart test failures described in the issue and the related fix in #4513. Trace the reported path through notebook/services/kernels/handlers.py and notebook/base/zmqhandlers.py, with Tornado's websocket and I/O errors as the starting point. Done means the Tornado 6 compatibility failures no longer occur in the affected tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
backend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.