Skip to content

Live process is not auto connected when app is launched in internalConsole #794

Closed

Description

@Eskibear

When a spring app is launched with "console": "internalConsole", live process is not auto connected.

In such case, I observe below details:

Java debugger reported correct processId:

{"event":"processid","body":{"processId":5952,"shellProcessId":-1,"type":"processid"},"seq":2,"type":"event"}

In debug console we have below error thrown by sts-vscode:

rejected promise not handled within 1 second: Error: No child process found for parent shell process with pid = -1

stack trace: Error: No child process found for parent shell process with pid = -1
    at c:\Users\<username>\.vscode-insiders\extensions\pivotal.vscode-spring-boot-1.36.0\out\lib\debug-config-provider.js:123:19
    at Generator.next (<anonymous>)
    at fulfilled (c:\Users\<username>\.vscode-insiders\extensions\pivotal.vscode-spring-boot-1.36.0\out\lib\debug-config-provider.js:28:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Currently the workaround is either of the following options:

  • Manually connect to the process.
  • Use "integratedTerminal" to launch the app.

Since java-debugger extension has already provided processId, it would be better to cover this case.

Activity

  1. Eskibear commented on Jun 27, 2022

    @Eskibear
    ContributorAuthor

    Looks like it's inspecting the wrong field.

    https://github.com/spring-projects/sts4/blob/dc36d1729891f401a153866875ac5a08df7af42e/vscode-extensions/vscode-spring-boot/lib/debug-config-provider.ts#L90-L93

    {
     shellProcessId: number  /* The process ID of the terminal shell if the process is running in a terminal shell.  */
     processId: number /* The process ID. */
    }
    

    From microsoft/java-debug#413 (comment)

    And AFAIK java-debugger extension now calculates processId on its own, covering various kind of terminals like cygwin/mingw, WSL, etc. It would probably be fixed by renaming pid to processId in L91?

  2. added this to the 4.15.2.RELEASE milestone on Jun 27, 2022
  3. BoykoAlex commented on Jun 27, 2022

    @BoykoAlex
    Contributor

    @Eskibear Thanks for bringing this up! Should be fixed now: f5f0dcb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: vscodestatus: assignedtheme: live-datatype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions