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

NullPointerException because "this.launcherFuture" is null #690

Closed
basilevs opened this issue Jun 7, 2023 · 0 comments · Fixed by #691
Closed

NullPointerException because "this.launcherFuture" is null #690

basilevs opened this issue Jun 7, 2023 · 0 comments · Fixed by #691

Comments

@basilevs
Copy link
Contributor

basilevs commented Jun 7, 2023

Following exception happens on shutdown (very rarely).

!ENTRY org.eclipse.lsp4e 4 0 2023-06-07 23:46:45.902
!MESSAGE java.lang.NullPointerException: Cannot invoke "java.util.concurrent.Future.isCancelled()" because "this.launcherFuture" is null
!STACK 0
java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "java.util.concurrent.Future.isCancelled()" because "this.launcherFuture" is null
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$9(LanguageServerWrapper.java:479)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.concurrent.Future.isCancelled()" because "this.launcherFuture" is null
	at org.eclipse.lsp4e.LanguageServerWrapper.isActive(LanguageServerWrapper.java:417)
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$5(LanguageServerWrapper.java:322)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.request(RemoteEndpoint.java:161)
	at org.eclipse.lsp4j.jsonrpc.services.EndpointProxy.invoke(EndpointProxy.java:91)
	at jdk.proxy10/jdk.proxy10.$Proxy32.shutdown(Unknown Source)
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$9(LanguageServerWrapper.java:477)
	... 4 more

The reason seems to be the lack of synchronization resulting in a change of a prechecked non-null value in the middle of expression computation.

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

Successfully merging a pull request may close this issue.

1 participant