Open steve-marmalade opened 2 years ago
Hi, I can not reproduce it on my machine, can you track the memory usage when you start Voila
? Does it relate to the specs of the machine?
Hi @trungleduc , thank you for the quick response!
I am happy to provide any debugging info that you think would be useful. I just did a rudimentary test by watching htop
while I started the voila
server, and I did not see any spike in memory usage that could explain the issue. My laptop also has 8 cores, so it doesn't seem like a n_kernels > n_cores issue either. For reference, the CLI crashes within about 5 seconds of starting, so it's not obviously a resource utilization issue.
Can you think of any other info I can provide that would be useful?
Your error is IndexError: pop from an empty deque
, it is likely related to this issue: https://github.com/jupyterlab/jupyterlab/issues/11934 The proper fix is likely somewhere else, but the underlying issue is that nest_asyncio
has a race condition if it gets patched in while there are events queued for execution on the asyncio loop.
@steve-marmalade I want to try the fix but can not reproduce the issue. Can you provide a minimal notebook to reproduce it?
@trungleduc Since this is a race-condition it can be pretty tricky to reproduce it. I haven't been able to see any direct correlation between notebook content and this behavior, but here are suspected things that might make it easier to reproduce as per my struggles in the lab issue:
IndexError: pop from an empty deque
in the stdlib's asyncio code. Ideally the code there should never be called if the nest_asyncio
patch is applied as early as possible, but this issues occurs when there are tasks queued on an unpatched loop once the patch
gets called. In that case there is a race while the original unpatched loop processes its queue, so the more tasks are on it when patch
gets called, the more likely it is to trigger.
Description
When launching
voila
with preheated kernels enabled and apool_size=2
in a directory with 4 notebooks, the server crashes with an inscrutable error. Thevoila
server runs successfully whenpool_size=1
.Reproduce
Edit
voila.json
as followsCreate a directory
dash/
with 4 notebooks.Run
voila
as follows:voila --port=8080 --no-browser --Voila.ip=0.0.0.0 --show_tracebacks=True dash/
The server will crash after a few seconds.
Expected behavior
Either:
Context
Troubleshoot Output
Command Line Output