-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Start ystore in a task #302
Conversation
e33d0a9
to
85c5220
Compare
jupyter_collaboration/rooms.py
Outdated
@@ -100,7 +103,9 @@ async def initialize(self) -> None: | |||
# try to apply Y updates from the YStore for this document | |||
read_from_source = True | |||
if self.ystore is not None: | |||
await self.ystore.started.wait() | |||
if not self.ystore.started.is_set(): | |||
self.create_task(self.ystore.start()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ystore.start() can throw RuntimeException if ystore task group is not None. There is another ystore.start() in yroom broadcast method. Since both the start method is scheduled asynchronously and there could a race condition, either of those two ystore.start() tasks can failed with RuntimeException due to ystore is already started. In this task, it might be ok to fail but in yroom.broadcast method, that exception could cause yroom task group to fail and restarted unless we handle the exception in yroom.broadcast implementation as well.
24e8c18 will need jupyter-server/pycrdt-websocket#43. |
Backport of #303.