Skip to content
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

Debugger does not kill all processes when terminated #338

Closed
jahan01 opened this issue Jul 17, 2020 · 1 comment
Closed

Debugger does not kill all processes when terminated #338

jahan01 opened this issue Jul 17, 2020 · 1 comment

Comments

@jahan01
Copy link

jahan01 commented Jul 17, 2020

Environment data

  • VS Code version: 1.47.2
  • Extension version (available under the Extensions sidebar): v2020.7.94776
  • OS and version: MacOS 10.15.5
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda

Expected behaviour

All process are killed when debugger is stopped / terminated.

Actual behaviour

Not all processes are stopped when debugger is terminated. I observed this pattern only when debugging multiprocess application like Flask, Celery. It leaves one zombie process running behind. I'll have to manually kill this process.

Steps to reproduce:

  1. Code
from flask import Flask
app = Flask(__name__)
app.run(host="0.0.0.0", port=5000, threaded=True, debug=True)
  1. launch.json
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "subProcess": true,
        },
  1. Start the debugger and terminate after it starts. The below process is left behind:
501 46232     1   0  9:52PM ??         0:11.50 xxxx/bin/python xxxx/.vscode/extensions/ms-python.python-2020.7.94776/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py --module --port 50912 --ppid 46228 --client 127.0.0.1 --client-access-token xxxx --multiprocess --json-dap-http --file test_debugpy
  1. When you try to debug the same file again without killing the zombie process, you will get Address in use exception.
  2. This happens when debugging other multiprocessing applications/libraries like celery.
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Jul 17, 2020
@int19h
Copy link
Contributor

int19h commented Aug 11, 2020

#359 should take care of this, as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants