-
Notifications
You must be signed in to change notification settings - Fork 10
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
adding exception handling for room start tasks #33
Conversation
19c131b
to
87eaafa
Compare
87eaafa
to
9f1a4b4
Compare
2cc7276
to
4deeaf5
Compare
4deeaf5
to
1f2a11c
Compare
Nice work @jzhang20133! Looks good to me! Let's merge and iterate from here. |
Thanks @jzhang20133. |
try: | ||
self._task_group.start_soon(self.ystore.write, update) | ||
self.log.debug("Writing Y update to YStore") | ||
except Exception as exception: | ||
self._handle_exception(exception) |
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.
I think that a follow-up to this PR would be to not handle exceptions here, but have a YStore have an optional exception handler, and do the handling there.
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.
Good point, @davidbrochart. I've created the following issue to track: #36
Sometimes, we have observed issues that task group in websocket_server is no longer active and user will be stuck after that and no longer able to access files and have to restart nb servers to unblock. _task_group instance variable in websocket_server will become inactive when one of its tasks of starting room or its children task group task fail with exception.
One place where an exception can occur is in the _broadcast_update method, which is a key task in children task group of _task_group in websocket_server. In this PR, the exception is handled and logged to prevent the parent task from crashing while still displaying the issue that will allow us better handle them in the future.
Resolving open source issues:
jupyterlab/jupyter-collaboration#290
jupyterlab/jupyter-collaboration#245