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

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

Closed
IKnewOne opened this issue Jul 6, 2023 · 8 comments
Milestone

Comments

@IKnewOne
Copy link

IKnewOne commented Jul 6, 2023

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
  • Operating System: Win 10 Home 22H2
  • JDK version: jdk-20.0.1.9-hotspot ( gradle is jdk-19.0.2.7-hotspot)((breaks even if both use jdk-19.0.2.7-hotspot))
  • Visual Studio Code version: 1.79.2
  • Java extension version: 1.20.0
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
Copy link
Contributor

snjeza commented Jul 6, 2023

@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
Copy link
Author

IKnewOne commented Jul 6, 2023

"-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
Copy link
Contributor

snjeza commented Jul 6, 2023

Enter a project, let it build

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

@IKnewOne
Copy link
Author

IKnewOne commented Jul 6, 2023

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
Copy link
Author

IKnewOne commented Jul 6, 2023

Duplicate of #3032

@IKnewOne IKnewOne changed the title Deadlock on workspaceStorage files on reload BundleException: Unable to acquire the state change lock for the module: osgi.identity Jul 6, 2023
@0dinD
Copy link
Contributor

0dinD commented Jul 7, 2023

@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 #3032 (comment) 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
Copy link
Contributor

snjeza commented Jul 13, 2023

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

@IKnewOne
Copy link
Author

@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 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants