Closed Flanker32 closed 6 years ago
https://github.com/Microsoft/vscode/issues/35196 C++ plugins also have the same problem before.
I haven't succeeded to reproduce the issue on my machine. I have tested https://github.com/eclipse/che. m2e creates the workspaceState.ser file with 3.7MB in size. MavenPluginActivator.stop() that calls writeWorkspaceState() takes less than a second.
@Flanker32 What project and OS are you using?
Java Language Server will do some job when close the sever and it may takes more than half a minute when the project is large enough.
RegistryManager.writeWorkspaceState will be called about half a minute later (in my computer) after the shutdown() fucntion was called
How much RAM does your computer have?
I use springboot as the test project. I do the experiment in Windows 10 1803 with 16G ram, and the xmx of jvm was set to 2G. @snjeza
I still can't reproduce the issue. @Flanker32 I think you close VS Code before spring-boot has been built. Try the following using the Git command line:
ls -l ~/AppData/Roaming/Code/User/workspaceStorage/<your_workspace_id>/redhat.java/jdt_ws/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser
You can see workspaceState.ser has been created correctly.
@snjeza Please remove springboot-gradle-plugin from the project for language server may meet some problems when open a maven project with gradle sub project. (Delete the folder spring-boot-project\spring-boot-tools\spring-boot-gradle-plugin and remove gradle tool item in pom file of spring-boot-tools) I redo the experiment with JDK 8 and the workspaceState.ser wasn't created when i close vscode, besides it takes me long time(about 5 minutes) to open springboot folder with vscode.
The issue can be reproduced on Windows. https://github.com/eclipse/eclipse.jdt.ls/pull/760 fixes it.
@fbricon We could call writeWorkspaceState in a save participant instead of in MavenPluginActivator.stop().
Related m2e bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=538609
Fixed within https://bugs.eclipse.org/bugs/show_bug.cgi?id=538609
Java Language Server will do some job when close the sever and it may takes more than half a minute when the project is large enough. However, VSCode will kill plugin in 5 seconds when it called shutdown function, which makes no time to save the worksapce infos, and language server will do maven reimport when it open an imported project.