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

Start the server awareness #78

Merged
merged 4 commits into from
Oct 14, 2024

Conversation

brichet
Copy link
Contributor

@brichet brichet commented Oct 14, 2024

This PR start the server awareness periodic update.

It follows jupyter-server/pycrdt#178.

@davidbrochart
Copy link
Collaborator

Let me know if you need help with this (I see tests are failing).

@brichet
Copy link
Contributor Author

brichet commented Oct 14, 2024

Yes, I took a look at the tests, it seems that test_yroom_restart never ends.

The tests pass if we remove the error if the awareness is already started. This probably means that the awareness is not properly stopped, but I don't know how to fix it.
And I'm not sure if we need to raise in this case.

@@ -231,6 +231,7 @@ async def start(
self._task_group.start_soon(self._stopped.wait)
self._task_group.start_soon(self._watch_ready)
self._task_group.start_soon(self._broadcast_updates)
self._task_group.start_soon(self.awareness.start)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need that above too, in the if from_context_manager: branch.

@@ -240,6 +241,7 @@ async def stop(self) -> None:
if self._task_group is None:
raise RuntimeError("YRoom not running")
self._stopped.set()
self.awareness.stop()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
self.awareness.stop()
await self.awareness.stop()

brichet and others added 2 commits October 14, 2024 22:13
Co-authored-by: David Brochart <4711805+davidbrochart@users.noreply.github.com>
@davidbrochart davidbrochart added the enhancement New feature or request label Oct 14, 2024
@brichet
Copy link
Contributor Author

brichet commented Oct 14, 2024

Thanks @davidbrochart

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 @brichet.

@davidbrochart davidbrochart merged commit b43acfd into jupyter-server:main Oct 14, 2024
7 of 8 checks passed
@brichet brichet deleted the start_server_awareness branch October 14, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants