Skip to content

Stop Debugging in a "noDebug" session doesn't kill subprocesses  #125

Closed

Description

@kenmillar253

VSCode Version: 1.42.1

OS Version: Ubuntu 18.04

Steps to Reproduce:

  • Comment "--noreload" in launch.json
  • Press Ctrl + F5 to run the django process.
  • Click "stop(Shift + F5)" button to stop all django processes.
  • But there is still a process (pid 23069) that has not been closed.
  • And its parent process become 1 from 23064

Activity

  1. kenmillar253 commented on Mar 10, 2020

    @kenmillar253
    Author

    Sorry, I posted the wrong place

  2. karthiknadig commented on Mar 10, 2020

    @karthiknadig
    Member

    kenmillar253 I moved this issue from python extension repo to the debugger repo. This issue should be looked at by the debugger first.

  3. kenmillar253 commented on Mar 10, 2020

    @kenmillar253
    Author

    kenmillar253 I moved this issue from python extension repo to the debugger repo. This issue should be looked at by the debugger first.
    Oh! I misunderstood your meaning, thanks!

  4. int19h commented on Mar 10, 2020

    @int19h
    Contributor

    This is probably #3

  5. kenmillar253 commented on Mar 11, 2020

    @kenmillar253
    Author

    This is probably microsoft/debugpy#3

    Hi Pavel Minaev (@int19h) , I have check this link #3.
    Then install debugpy-1.0.0b3, ptvsd-5.0.0a12 and pydevd-1.9.0
    The child process is still not auto-kill.

    As you mentioned, how can I set launch.json to perform its own cleanup? Which args?

  6. karthiknadig commented on Mar 11, 2020

    @karthiknadig
    Member

    kenmillar253 don't install debugpy, ptvsd, or pydevd. This does not matter, since you are using launch configuration, the python extension will pick the debugger for you. Follow the instructions here to get the right debugger:
    #59

  7. kenmillar253 commented on Mar 11, 2020

    @kenmillar253
    Author

    Karthik Nadig (@karthiknadig) I have install this dev vsix now.
    And when this parameter --noreload is added, there will be 2 processes, all child processes can be closed. But when comment it, there will be 3 processes, only two of them were killed.

  8. kenmillar253 commented on Mar 11, 2020

    @kenmillar253
    Author

    Screenshot from 2020-03-11 14-20-24

  9. int19h commented on Mar 11, 2020

    @int19h
    Contributor

    If you do import ptvsd; print(ptvsd.__version__) at the beginning of your code, what does it print?

  10. kenmillar253 commented on Mar 11, 2020

    @kenmillar253
    Author

    Pavel Minaev (@int19h) It print 5.0.0a12

    Screenshot from 2020-03-11 14-31-46

    There is one child process not closed with its parent pid become 1
    Screenshot from 2020-03-11 14-30-24

  11. int19h commented on Mar 24, 2020

    @int19h
    Contributor

    Mystery solved - the reason why I couldn't repro is because I didn't notice that you were using Ctrl+F5 (i.e. running without debugging).

    The problem is that when we're not debugging, we're also not able to detect subprocesses. So when you stop the no-debug session, we kill the parent Django process, but not the child process that it had spawned.

    We'll need to add some special cleanup to the launcher to kill the entire process tree in this scenario.

  12. changed the title [-]vscode didn't close all django processes when comment "--noreload"[/-] [+]Stop Debugging doesn't kill subprocesses[/+] on Aug 6, 2020
  13. changed the title [-]Stop Debugging doesn't kill subprocesses[/-] [+]Stop Debugging in a "noDebug" session doesn't kill subprocesses [/+] on Aug 6, 2020
  14. added 4 commits that reference this issue on Aug 7, 2020
    76c5549
    6fe5fb0
    e2a2de8
    ccbb225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions