redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 431 forks source link

BundleException: Unable to acquire the state change lock for the module: osgi.identity #3184

Closed IKnewOne closed 1 year ago

IKnewOne commented 1 year ago

Exiting VSC leaves a java process that blocks workspaceStorage/redhat.java files leading to deadlock on the files, thus breaking any functionality until i terminate the process manually, delete the redhat.java folder and start vscode. Neither developer reload for the window, nor java clearnup works. The latter doesn't work due to the same lock on the files.

Environment
Steps To Reproduce
  1. Enter a project, let it build
  2. Exit the vscode
  3. Re-enter the same project, it will not load

Cannot attach the project In terms of logs, it's always the same first error of a deadlock appearing instead of proper project firstlogmessage.txt

Current Result

The project doesn't load java and endlessly send messages of a deadlock of over 30000ms

Expected Result

Proper functionality

Additional Informations
snjeza commented 1 year ago

@IKnewOne Could you try to set

"java.jdt.ls.vmargs": "-DwatchParentProcess=false <your_jvmargs",

for instance,

"java.jdt.ls.vmargs": "-DwatchParentProcess=false -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx6G -Xms512m -Xlog:disable",
IKnewOne commented 1 year ago

"-DwatchParentProcess=false" didn't seem to fix it entirely, but it looks like the file isn't blocked anymore whenever i try to clean and reload java workspace via command or even when exiting the vscode. But the error rarely appears after a java workspace reload. At least from what i can tell

Changing java settings, which forced the reload with the new settings in place, seem to make the vscode behave until reload, even with the java clean workspace command, but it still fails after closing the vscode.

Overall, it kinda makes it better, but it's still manual fixing

snjeza commented 1 year ago

Enter a project, let it build

Are you sure the build is complete? Could you attach your log? - Enable Logging

IKnewOne commented 1 year ago

Here's a log with empty redhat.java first run with ample time to build, followed by vscode exit, followed by opening vscode a second time and a third time serverLog.txt

IKnewOne commented 1 year ago

Duplicate of #3032

0dinD commented 1 year ago

@snjeza This appears to be a regression in vscode-java 1.20.0. In previous versions, I had not noticed #3032, but as of vscode-java 1.20.0, the issue occurs 100% of the time for me when working on Gradle projects (given a few preconditions, see https://github.com/redhat-developer/vscode-java/issues/3032#issuecomment-1615349170 for more details).

Currently I have downgraded to vscode-java 1.19.0 as a workaround, because I'm working on Gradle projects, and this issue is very annoying as it basically forces you to run Java: Clean Java Language Server Workspace every time you start VSCode.

snjeza commented 1 year ago

@0dinD @IKnewOne Could you, please, test VS Code 1.22.0 ?

IKnewOne commented 1 year ago

@snjeza so far seems to work with no issues on reload/bad exit/etc. Lombok and warnings are not being nice for some reason, but i hope that's irrelevant to the current issue so this is probably a fixed issue now ( until, of course, it regresses again )