Closed mrocklin closed 1 year ago
Things also seem better if we spawn a process earlier when setting things up. In particular I'm running the following:
from distributed.utils import mp_context
mp_context.Process(target=time.sleep, args=(0,)).start()
Early on in our asgi application script, right around where django.setup()
is called.
Closing this to tidy things up. Should still show up if people are searching.
We're debugging a tricky issue between Dask and Django/Daphne. I thought I'd record some of this here in case other people run into this same problem in the future.
Coiled launches a Dask cluster as part of the web backend. We use this for offloading computation for things like solving conda environments. Recently we did some work to merge the Dask and Django/Daphne event loops, and now we're getting the following error when we start up a Dask worker/nanny process
This fails on Python 3.7 and 3.8. It fails when using the spawn and forkserver multiprocessing contexts, but doesn't seem to fail when we use fork.
No one has to do anything for this. I'm just recording this because it ended up being a tricky debugging issue, and because information on this error on the web is sparse.