jupyterlab / jupyter-collaboration

A Jupyter Server Extension Providing Support for Y Documents
https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/
Other
153 stars 29 forks source link

Adopt AnyIO #252

Open davidbrochart opened 5 months ago

davidbrochart commented 5 months ago

Problem

I'm seeing this error due to aiosqlite, for instance in the CI:

Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\site-packages\aiosqlite\core.py", line 120, in run
    future.get_loop().call_soon_threadsafe(set_exception, future, e)
  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\asyncio\base_events.py", line 807, in call_soon_threadsafe
    self._check_closed()
  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\asyncio\base_events.py", line 520, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

I also saw this kind of errors in Jupyverse, where I'm switching to sqlite-anyio (here).

Proposed Solution

In general, jupyter-collaboration could benefit from structured concurrency, just like pycrdt-websocket did.

dlqqq commented 5 months ago

Found a possibly related upstream issue: https://github.com/omnilib/aiosqlite/issues/241