dask.distributed client hangs in VSCode
See original GitHub issueAssistance request for those using vscode (https://github.com/microsoft/vscode-python/issues/7845):
dask - 2.6.0 vscode - 1.39.2 (latest but version independent) python extension - 2019.10.41019 (it’s tied to this version but vscode team cannot find issue without diving into dask)
Steps for bug
from dask.distributed import Client
client = Client()
- start
Python Interactive
and paste this in input terminal and we get never ending stream of
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Restarting worker
...
- restart notebook server (using interactive window) and run same code and it runs fine.
If you run this code in python, ipython or jupyter notebook, no problems.
If anyone using vscode this is very easy to reproduce and if you can find a possible cause for the error I can open a new issue and hopefully point the team towards the right direction.
Thank you
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:25 (11 by maintainers)
Top Results From Across the Web
dask.distributed client hangs in VSCode · Issue #5574 - GitHub
One approach to resolve this problem would be to try to reproduce the error without Dask, and then raise that back on the...
Read more >Dask Distributed with MS VS2017 - Stack Overflow
However, the code crashes and no dashboard loads under Visual Studio. Both IDEs are running under the same environment I am using the...
Read more >Debug - Dask documentation
Logging for specific components like distributed.client , distributed.scheduler , distributed.nanny , distributed.worker , etc.
Read more >Distributed Python at home: DASK with VSCode on top.
Data scientists, and others, can write and test parallel/ distributed python code on their local machines without complicated using DASK and ...
Read more >Distributed Computing with dask - Practical Data Science
from dask.distributed import Client client = Client() client ... is that to prevent crashes, you have to understand how and why dask is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@harrisliuwk I have experienced the same, it is tied to multiprocessing.
I agree with @mrocklin to reproduce this using just the multiprocessing and asyncio modules and find the (timing) issues mentioned in https://github.com/microsoft/vscode-python/issues/7845#issuecomment-543990049.
I have been using dask-kubernetes in azure aks and stopped trying to find the issue.
EDIT: just ran a quick test in VSCode
generates an endless stream of errors:
versions: dask:
2.20.0
distributed:2.20.0
ms-python extension:2020.7.94776
python:3.8.3
os:linux
Just an update on identifying the problem.
platform: Windows 10 Version 1809 Dask: 2.20.0 VSCode: 1.47.2
It seems that the problem is compatibility between Dask and VSCode’s Python Interactive Window.
When you do
and
both work well with powershell and VSCode’s Jupyter notebook environment. Note that the default for both
Client
andLocalCluster
isprocesses=True
.But if you run the example codes above in Python Interactive Window, it just hangs forever, and there’s no error message printed out. Instead if you do
and
in Interactive Window, the code will run as expected.