vscode-python: Multithreaded Application under debugger very slow.

I have an application/library that uses multiple threads. It normally runs in a few seconds, but when launched under the debugger using python (current file)

Environment data

  • VS Code version: Version 1.25.0-insider (1.25.0-insider)
  • Extension version (available under the Extensions sidebar): 2018.6.0
  • OS and version: Mac OS 10.13.5 (Macbook Pro 2017 15 inch)
  • Python version: CPython 3.6.5 installed via PyEnv
  • Type of virtual environment used : venv

Actual behavior

Code runs quickly to the point where threads are spun up. Then, it doesn’t hit the following line of the main thread.

Attempting to pause doesn’t seem to work.

If you set no breakpoints it does run to completion without issue.

Expected behavior

Expect after the threads are started (less than a second of time) for the next line of the main program to be reached by the debugger.

Steps to reproduce:

I was able to reduce this to three files: watch.py, bidy.py, repro.py Archive.zip

Setup Environment

  1. python3 -m venv venv3
  2. source venv3/bin/activate
  3. pip install google-cloud-firestore

In VS Code

  1. Set breakpoint on line 64 doc_ref.set({ which follows the call to spawn threads
  2. run current file for repro.py

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

> cd /Users/crwilcox/workspace/repro-vscode ; env "PYTHONIOENCODING=UTF-8" "PYTHONUNBUFFERED=1" /Users/crwilcox/workspace/google-cloud-python-firestorewatch/venv3/bin/python /Users/crwilcox/.vscode-insiders/extensions/ms-python.python-2018.6.0/pythonFiles/PythonTools/visualstudio_py_launcher.py /Users/crwilcox/workspace/repro-vscode 56482 34806ad9-833a-4524-8cd6-18ca4aa74f14 RedirectOutput,RedirectOutput /Users/crwilcox/workspace/repro-vscode
/repro.py

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@DonJayamanne Gladly. I am still trying to figure out how to describe what is happening but as soon as I nail down what is going on I will open a new issue. Thanks!