-
Notifications
You must be signed in to change notification settings - Fork 22
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
Esbonio crashes when Sphinx Immaterial Theme is used #451
Comments
I suspect the issue has to do with nesting of asyncio stuff. In principle the code in sphinx-immaterial for downloading resources could be changed to not use asyncio. But it would be better if that were not necessary. I wonder if using Still it is odd that it would hang rather than raise an exception. Perhaps you can do some additional debugging and try to figure out the cause a bit more? |
The Esbonio language server runs its own asyncio loop context when it invokes the Sphinx code. This causes the asyncio.run() call to complain since it's already being run in the same thread. Since we're already running a set of threads here using PoolExecutor, we can run one more thread which runs the asyncio.run() context in a separate thread. This mitigates the interoperability issue with the Esbonio language server at the cost of an additional thread, and at the cost of blocking the coroutine loop within the Esbonio language server for the closing of the download set. (See also swyddfa/esbonio#451)
The Esbonio language server runs its own asyncio loop context when it invokes the Sphinx code. This causes the asyncio.run() call to complain since it's already being run in the same thread. Since we're already running a set of threads here using PoolExecutor, we can run one more thread which runs the asyncio.run() context in a separate thread. This mitigates the interoperability issue with the Esbonio language server at the cost of an additional thread, and at the cost of blocking the coroutine loop within the Esbonio language server for the closing of the download set. (See also swyddfa/esbonio#451)
This issue has been fixed now by immaterial theme and can therefore be closed. |
Immaterial theme looks like a good replacement for the not so good maintained RTD Theme.
Esbonio however has a problem with it.
On first startup the theme downloads and caches Google fonts.
https://github.com/jbms/sphinx-immaterial/blob/8c94664fd56baa87abf023a7b3aa7748c3c15828/sphinx_immaterial/external_resource_cache.py#L129
It works fine with a local sphinx-build.
Esbonio does not seem to like this async download step during its build and just hangs.
I have raised an issue at Immaterial theme as well
jbms/sphinx-immaterial#163
The text was updated successfully, but these errors were encountered: