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

Remove client on failure #94

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

darabos
Copy link
Contributor

@darabos darabos commented Dec 10, 2024

Resolves #87. Without this I'm getting more and more exceptions as I accumulate more and more disconnected clients. E.g.:

    +---------------- 15 ----------------
    | Traceback (most recent call last):
    |   File "/Users/danieldarabos/lynxkite-2000/.venv/lib/python3.11/site-packages/pycrdt_websocket/asgi_server.py", line 33, in send
    |     await self._send(
    |   File "/Users/danieldarabos/lynxkite-2000/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 48, in sender
    |     await send(message)
    |   File "/Users/danieldarabos/lynxkite-2000/.venv/lib/python3.11/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 358, in asgi_send
    |     raise RuntimeError(msg % message_type)
    | RuntimeError: Unexpected ASGI message 'websocket.send', after sending 'websocket.close' or response already completed.
    +---------------- ... ----------------
    | and 3389 more exceptions
    +------------------------------------

Copy link
Collaborator

@davidbrochart davidbrochart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @darabos.
I see that we never remove clients from the room, so this change seems to be needed even when there is no failure.

@davidbrochart davidbrochart added the bug Something isn't working label Dec 10, 2024
@davidbrochart davidbrochart merged commit d208ff0 into jupyter-server:main Dec 10, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling disconnects
2 participants