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

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

Closed
martinlippert opened this issue May 7, 2021 · 14 comments
Closed
Labels
for: vscode something that is specific for VSCode status: waiting-for-feedback type: bug

Comments

@martinlippert
Copy link
Member

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.

@martinlippert martinlippert added this to the 4.11.0.RELEASE milestone May 7, 2021
@andriassundskard
Copy link

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

@andriassundskard
Copy link

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

@martinlippert
Copy link
Member Author

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

@andriassundskard
Copy link

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

@martinlippert
Copy link
Member Author

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.

@andriassundskard
Copy link

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.

@Artur-
Copy link

Artur- commented May 21, 2021

I guess this is also what I see on Big Sur

$ ps ax|grep BootLanguagServerBootApp|wc -l
      48

@zlargon
Copy link

zlargon commented May 21, 2021

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
...

@martinlippert
Copy link
Member Author

martinlippert commented May 25, 2021

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

@martinlippert
Copy link
Member Author

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.

@andriassundskard
Copy link

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.

@martinlippert
Copy link
Member Author

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

@andriassundskard
Copy link

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

@martinlippert
Copy link
Member Author

@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
Labels
for: vscode something that is specific for VSCode status: waiting-for-feedback type: bug
Projects
None yet
Development

No branches or pull requests

4 participants