Skip to content

language server processes doesn't get shutdown properly in VSCode #636

Closed

Description

@martinlippert

Describe the bug
Dave observed a number of zombie language server processes, probably after using VSCode. The thread dumps of the VSCode processes look okay, nothing serious in there, but the shutdown process must have gone wrong somewhere.

To Reproduce
We need to investigate this, use VSCode for a while and see if language server processes are shutdown properly or not.

Activity

  1. added this to the 4.11.0.RELEASE milestone on May 7, 2021
  2. andriassundskard commented on May 14, 2021

    @andriassundskard

    Happens to me on MacOS 11.3.1 and VSCode 1.56.2. I start my VSCode using this command: code --user-data-dir ~/.vscode_MyApp/user-data --extensions-dir ~/.vscode_MyApp/exts MyApp.code-workspace

    MyApp.code-workspace
    {"folders":[{"path":"."}],"settings":{"[yaml]":{"editor.insertSpaces":true,"editor.detectIndentation":false,"editor.tabSize":2,"editor.autoIndent":"advanced","editor.quickSuggestions":{"other":true,"comments":false,"strings":true}},"[java],[xml]":{"editor.suggest.snippetsPreventQuickSuggestions":false,"editor.tabSize":4,"editor.insertSpaces":false,"editor.detectIndentation":false},"java.configuration.updateBuildConfiguration":"automatic","java.completion.enabled":true,"java.format.enabled":true,"java.format.settings.profile":"GoogleStyle","java.format.settings.url":"/eclipse-java-google-style.xml","java.autobuild.enabled":true,"java.saveActions.organizeImports":true,"gradle.autoDetect":"on","editor.autoIndent":"full","spring.initializr.defaultLanguage":"Java","files.exclude":{"**/.classpath":true,"**/.project":true,"**/.settings":true,"**/.factorypath":true,"**/.gradle":true},"java.dependency.packagePresentation":"flat"},"extensions":{"recommendations":["vscjava.vscode-java-pack","GabrielBB.vscode-lombok","richardwillis.vscode-gradle","alphabotsec.vscode-eclipse-keybindings","vscjava.vscode-spring-initializr","Pivotal.vscode-spring-boot","vscjava.vscode-spring-boot-dashboard","ms-azuretools.vscode-docker","adamhartford.vscode-base64","redhat.vscode-xml"]},"launch":{"configurations":[{"type":"java","name":"Launch MyApp","request":"launch","mainClass":"com.example.MyApp","projectName":"MyApp"}],"compounds":[]}}

    Running ps ax | grep java | grep language-server after closing VSCode gives this:

    3724 ?? S 0:11.61 /usr/bin/java -cp /Users/username/.vscode_MyApp/exts/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes:/Users/username/.vscode_MyApp/exts/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/lib/* -Dspring.lsp.client-port=45556 -Dserver.port=45556 -Dsts.lsp.client=vscode -Dsts.log.file=/dev/null -XX:TieredStopAtLevel=1 -Dspring.config.location=file:/Users/username/.vscode_MyApp/exts/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes/application.properties org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp

  3. andriassundskard commented on May 17, 2021

    @andriassundskard

    exthost.log
    I managed to get some kind of debug log out of the system. Hopefully it is of some help!

  4. martinlippert commented on May 18, 2021

    @martinlippert
    MemberAuthor

    @andriassundskard Thanks for the additional details, much appreciated. How did you get these debug log output?

  5. andriassundskard commented on May 19, 2021

    @andriassundskard

    I enabled logging through the properties file: ~/.vscode_MyApp/exts/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes/application.properties

    I removed the # from these lines and restarted VSCode.
    #logging.level.org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer=debug #logging.level.org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava=debug #logging.level.org.springframework.ide.vscode.boot.app.SpringSymbolIndex=debug #logging.level.org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp=off

  6. martinlippert commented on May 19, 2021

    @martinlippert
    MemberAuthor

    Those log levels are for the Spring Boot language server itself, but the exthost.log output seems to be from VSCode directly, not the Spring Boot language server.

  7. andriassundskard commented on May 19, 2021

    @andriassundskard

    I found, that there is a logs folder in ~/.vscode_MyApp/user-data/. After enabling the Spring Boot logging through the application.properties file I realized, that some log entries ended up in the exthost.log file located in ~/.vscode_MyApp/user-data/logs/yyyyMMddTHHmmss/exthost1 folder.

  8. Artur- commented on May 21, 2021

    @Artur-

    I guess this is also what I see on Big Sur

    $ ps ax|grep BootLanguagServerBootApp|wc -l
          48
    
  9. zlargon commented on May 21, 2021

    @zlargon

    I also see this on my mac.

    Mac: macOS Catalina 10.15.7
    VSCode: 1.56.2 (Universal)

    $ ps aux | grep BootLanguagServerBootApp
    
    chhuang          22530   0.0  0.1 10439568  13348   ??  S     2:14PM   0:18.97 /Users/chhuang/.sdkman/candidates/java/11.0.11-zulu/bin/java -cp /Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes:/Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/lib/* -Dspring.lsp.client-port=45557 -Dserver.port=45557 -Dsts.lsp.client=vscode -Dsts.log.file=/dev/null -XX:TieredStopAtLevel=1 -Dspring.config.location=file:/Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes/application.properties org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp
    chhuang           8964   0.0  0.1 10590152  16252   ??  S     9:42AM   0:38.26 /Users/chhuang/.sdkman/candidates/java/11.0.11-zulu/bin/java -cp /Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes:/Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/lib/* -Dspring.lsp.client-port=45556 -Dserver.port=45556 -Dsts.lsp.client=vscode -Dsts.log.file=/dev/null -XX:TieredStopAtLevel=1 -Dspring.config.location=file:/Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes/application.properties org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp
    chhuang           8869   0.0  0.1 10594272  16452   ??  S     9:41AM   0:39.97 /Users/chhuang/.sdkman/candidates/java/11.0.11-zulu/bin/java -cp /Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes:/Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/lib/* -Dspring.lsp.client-port=45556 -Dserver.port=45556 -Dsts.lsp.client=vscode -Dsts.log.file=/dev/null -XX:TieredStopAtLevel=1 -Dspring.config.location=file:/Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes/application.properties org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp
    chhuang           7237   0.0  0.1 10441616  13516   ??  S     9:17AM   0:31.23 /Users/chhuang/.sdkman/candidates/java/11.0.11-zulu/bin/java -cp /Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes:/Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/lib/* -Dspring.lsp.client-port=45556 -Dserver.port=45556 -Dsts.lsp.client=vscode -Dsts.log.file=/dev/null -XX:TieredStopAtLevel=1 -Dspring.config.location=file:/Users/chhuang/.vscode/extensions/pivotal.vscode-spring-boot-1.25.1/language-server/BOOT-INF/classes/application.properties org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp
    ...
  10. martinlippert commented on May 25, 2021

    @martinlippert
    MemberAuthor

    I think I can reproduce this on my local machine, seems a more general issue here. Will investigate further.

  11. martinlippert commented on May 26, 2021

    @martinlippert
    MemberAuthor

    I implemented some improvements here, so feel free to manually install the latest CI build as VSIX file from here: http://dist.springsource.com/snapshot/STS4/nightly-distributions.html - and let me know if this is better now.

    I am sure there are still a few cases in which the process is not stopped accordingly. If you still observe dangling BootLanguageServerApp processes, it would be great if you could share some details how you got to that point, so that I can follow the steps precisely to reproduce this.

  12. andriassundskard commented on May 27, 2021

    @andriassundskard

    Seems to be working now. I'm not sure if it is a problem, but with this new version there is no org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp in my ps ax list while VSCode is running. Plugin seems to work as intended.

  13. martinlippert commented on May 27, 2021

    @martinlippert
    MemberAuthor

    @andriassundskard The name has changed, we fixed the typo, it is now BootLanguageServerBootApp

  14. andriassundskard commented on May 27, 2021

    @andriassundskard

    Ok. ps ax | grep BootLanguageServerBootApp is also empty, so it seems that your solution works!

  15. martinlippert commented on May 27, 2021

    @martinlippert
    MemberAuthor

    @andriassundskard great to hear that and thanks for checking it out. Much appreciated. Closing this now.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: vscodestatus: waiting-for-feedbacktype: bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions