Skip to content

Server occaionaly logs error when a websocket disconnects #2969

@0x26res

Description

@0x26res

Bug Report

Steps to Reproduce:

This is very similar to #2132 which was fixed but came back recently.
There's been a lot of changes since then.

  1. run the python-tornado-streaming example
  2. refresh the webpage very quickly (like press CTRL+R very fast)

I found it is easier to reproduce if you reduce the size of the data set, from 2500 to 25 and reduce the def data_source() update size as well.

Expected Result:

it should work fine

Actual Result:

I can see this in the std err:

2025-04-03 15:40:31,865 - asyncio - ERROR - Task exception was never retrieved
future: <Task finished name='Task-68583' coro=<WebSocketProtocol13.write_message.<locals>.wrapper() done, defined at /opt/pysetup/.venv/lib/python3.12/site-packages/tornado/websocket.py:1086> exception=WebSocketClosedError()>
Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/tornado/websocket.py", line 1088, in wrapper
    await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/tornado/websocket.py", line 1090, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
2025-04-03 15:40:31,870 - tornado.application - ERROR - Exception in callback functools.partial(<built-in method poll of perspective.PySyncSession object at 0x7f98eb977510>)
Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/tornado/ioloop.py", line 750, in _run_callback
    ret = callback()
          ^^^^^^^^^^
ValueError: Session RwLock { value: None } already deleted

Though the server keeps working fine.

Environment:

For Python

  • Python 3.12.9
  • perspective-python==3.4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions