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

[New Issue] When using pycrdt-websocket 0.13.1, file access in jupyterlab can hang #41

Open
jzhang20133 opened this issue May 2, 2024 · 1 comment

Comments

@jzhang20133
Copy link
Collaborator

When using pycrdt-websocket 0.13.1, file access in jupyterlab can hang.

small.file.hangs.mp4

Error logs shows that when ystore.read() method is called before ystore db initialization finishes, it is waiting on an old Event created in __init__ method and ystore.start() method has assigned a new Event. And the old Event() is never set hence file access is blocked.

Error Logs:

[I 2024-05-02 11:10:30.558 ServerApp] Creating new notebook in /TestRTC2
[I 2024-05-02 11:10:30.988 ServerApp] Request for Y document 'TestRTC2/Untitled62.ipynb' with room ID: e6db9699-d261-481e-a188-d76652c290b8
[I 2024-05-02 11:10:31.329 YDocExtension] Creating FileLoader for: TestRTC2/Untitled62.ipynb
initialize ystore, self.db_initialized=<anyio._backends._asyncio.Event object at 0x7ff5a83355a0>
[I 2024-05-02 11:10:31.332 YDocExtension] Watching file: TestRTC2/Untitled62.ipynb
[I 2024-05-02 11:10:31.337 ServerApp] Initializing room json:notebook:e6db9699-d261-481e-a188-d76652c290b8
read data, self.db_initializer=<anyio._backends._asyncio.Event object at 0x7ff5a83355a0>
starting initialize db, self.db_initialized=<anyio._backends._asyncio.Event object at 0x7ff5a8335a80>
ended initialize db, self.db_initialized=<anyio._backends._asyncio.Event object at 0x7ff5a8335a80>

We can see that read data, self.db_initializer=<anyio._backends._asyncio.Event object at 0x7ff5a83355a0> is waiting on an old Event which is never set. Since after start method is called, self.db_initialized is replaced with a new Event.

starting initialize db, self.db_initialized=<anyio._backends._asyncio.Event object at 0x7ff5a8335a80>
ended initialize db, self.db_initialized=<anyio._backends._asyncio.Event object at 0x7ff5a8335a80>
Copy link

welcome bot commented May 2, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant