You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenRewrite unchecked, but always Language Server Background Job(Loading Rewrite Recipes) #925
Thanks @w6et for reporting this, the language server is probably loading the OpenRewrite recipes nevertheless the preference is disabled - and therefore doesn't need to do that. We should change that.
But the activity should really happen just once and not multiple times. Do you see this progress view entry multiple times? And do they run for a very long time (or even all the time)? Or do they disappear from the progress view again?
But the activity should really happen just once and not multiple times. Do you see this progress view entry multiple times? And do they run for a very long time (or even all the time)? Or do they disappear from the progress view again?
@martinlippert yes,happen multiple times, and highly increased memory consumption together.
I'm not sure how to trigger languageServer ,I guess(looks like by Progress view)
hover on javaSourceWindow
sendClasspathNotifications
or other else,
when javaSourceWindow hang or other else,started timeout,so languageServer has been launched multiple times.
@w6et@gbaso I'd like to check if there are more than one language server started in these case or is it just the progress that is never terminated.
II wonder if you could try the following:
Shut down STS and vodecode and make sure that jps command executed from the terminal does not have BootLanguageServerBootApp in the list of java processes.
Start STS, work with your java code. Once you notice multiple Loading Rewrite Recipes jobs in the progress dialog run jps command again and take a note of how many BootLanguageServerBootApp are there. Wait 30 sec and run jps again, check if number of BootLanguageServerBootApp has changed.
Also, I'm curious whether you are seeing multiple Loading Rewrite Recipes jobs at startup of STS or eventually after working in STS for some time. Do you recall performing changes to maven pom or gradle build files right before seeing those rogue jobs?
@w6et@gbaso Can you also enable the preference to push the logs from the Spring Boot language server via: Preferences -> Language Servers -> Spring Language Servers, then activate the Spring Boot entry, then retry the IDE. From there on, the log from the language server process appears in your Console view. Maybe you can paste the content of that log output while those problems appear that you describe?
In addition to that it would also be interesting to see if the problem completely goes away if you disable the Spring Boot language server altogether from the Preferences -> Language Servers list for all the file associations.
Part One.
The Boot LS process sometimes doesn't start normally. There is no logging info for this as logging didn't seem to start in this case at all.
For example Eclipse side logging is:
ENTRY org.eclipse.lsp4e 1 0 2023-05-07 22:39:47.517
!MESSAGE getLSWrappers(document)
!ENTRY org.eclipse.lsp4e 1 0 2023-05-07 22:39:47.517
!MESSAGE About to start LS via Wrapper `org.eclipse.languageserver.languages.springboot'. Currently started wrappers (total=0):
!ENTRY org.eclipse.lsp4e 1 0 2023-05-07 22:39:47.531
!MESSAGE Creating Wrapper for `org.eclipse.languageserver.languages.springboot' with initialPath=null project=resource
!ENTRY org.eclipse.lsp4e 1 0 2023-05-07 22:39:47.532
!MESSAGE Starting LS 'org.eclipse.languageserver.languages.springboot'
!ENTRY org.springframework.tooling.boot.ls 1 0 2023-05-07 22:39:47.700
!MESSAGE DelegatingStreamConnectionProvider - Starting Boot LS
!ENTRY org.springframework.tooling.ls.eclipse.commons 1 0 2023-05-07 22:39:47.714
!MESSAGE Started org.springframework.tooling.boot.ls LS process 2464
!ENTRY org.eclipse.lsp4e 1 0 2023-05-07 22:39:47.715
!MESSAGE LS `org.eclipse.languageserver.languages.springboot' process is started: 6188
!ENTRY org.eclipse.lsp4e 1 0 2023-05-07 22:39:47.931
!MESSAGE Initializing server-client comm for LS `org.eclipse.languageserver.languages.springboot' with pid=6188
!ENTRY org.eclipse.lsp4e 1 0 2023-05-07 22:39:47.949
!MESSAGE Sending initialize message to LS `org.eclipse.languageserver.languages.springboot' with pid=6188
!ENTRY org.eclipse.lsp4e 2 0 2023-05-07 22:39:48.795
!MESSAGE Could not get if the workspace folder capability is supported due to timeout after 1 second
!STACK 0
java.util.concurrent.TimeoutException
at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1960)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095)
at org.eclipse.lsp4e.LanguageServerWrapper.supportsWorkspaceFolderCapability(LanguageServerWrapper.java:587)
at org.eclipse.lsp4e.LanguageServerWrapper.canOperate(LanguageServerWrapper.java:576)
at org.eclipse.lsp4e.LanguageServerWrapper.c
There is no matching log entries on the LS side (no entries at 22:39:47 and 22:39:48):
1:18:03.765 [pool-11-thread-1] INFO o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///C:/Users/youca/Documents/Eclipse_Workspace_JDK17/eStore_v2/orders/src/main/java/net/subnoize/estore/orders/model/Order.java
01:18:03.790 [pool-11-thread-1] INFO o.s.i.v.c.l.u.SimpleTextDocumentService - Closed: file:///C:/Users/youca/Documents/Eclipse_Workspace_JDK17/eStore_v2/resource/src/main/java/net/subnoize/estore/orders/OrderController.java
01:18:03.790 [pool-11-thread-1] INFO o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///C:/Users/youca/Documents/Eclipse_Workspace_JDK17/eStore_v2/resource/src/main/java/net/subnoize/estore/orders/OrderController.java
22:39:52.748 [main] INFO o.s.i.v.b.a.BootLanguageServerBootApp - Starting BootLanguageServerBootApp using Java 17.0.6 with PID 1864 (C:\Data\Java\sts-4.18.0.RELEASE\plugins\org.springframework.tooling.boot.ls_1.46.0.202304251920\servers\spring-boot-language-server\BOOT-INF\classes started by youca in C:\Data\Java\sts-4.18.0.RELEASE)
22:39:52.756 [main] INFO o.s.i.v.b.a.BootLanguageServerBootApp - No active profile set, falling back to 1 default profile: "default"
22:39:54.200 [main] INFO o.s.i.v.boot.app.SpringSymbolIndex - project listener registered
22:39:54.989 [main] INFO o.s.i.v.b.a.BootLanguageServerBootApp - Started BootLanguageServerBootApp in 2.635 seconds (process running for 3.151)
22:39:54.990 [main] INFO o.s.i.v.c.l.LanguageServerRunner - java.home = C:\Data\Java\sts-4.18.0.RELEASE\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.6.v20230204-1729\jre
22:39:54.991 [LanguageServerApp-lifecycle] INFO o.s.i.v.c.l.LanguageServerRunner - Server ready to start after 3154 ms
as nothing has been received from the language server at all, however, the process seem to have started...
Part Two
Attempt to start the second language server while the first one is either stuck or being initialized or just slow. The attempt to start the second language server comes from the fact that the check whether currently started LS can work on a document from one of the projects in the workspace returns false, hence the same definition language server is being started.
The check would start returning true if server was marked as singleton.
Another instance of starting the same boot LS can be initiated from the LanguageServerWrapper#start() method if comm pipe has been closed (failed LS process start i suppose). This re-start is valid though...
I'd try to limit Boot LS t only one process/LS wrapper properly by setting singleton property in the extension point: b19c16c Should be available in the next snapshot build of STS4 for Eclipse. Will post here once available.
@youcangetme how's it going with the new sts4 snapshot and a modified lsp4e? Have you been busy and not had time to watch this stuff or is it just working now? :-)
Hmmmm, I have not seen the language server go nuts on any machine with the new patches installed. I am wary to pronounce it "fixed." But I am willing to say (while knocking on wood) "sure, give it prime time exposure and see."
@youcangetme could you please attach your logs (eclipse and boot ls) from these few past days? Are STS tools working though? Do you see content assists in boot properties files, spring symbols showing up after Ctrl-6, etc?
I think the singleton property for the LS extension point is the real fix to the problem... Stuff that went into LSP4E is mostly for logging... Thus if at some point you switch to just the snapshot distro of STS4 it should work just as well ideally.
@youcangetme I have gone through the logs and it seems fixed to me - only one Boot LS at all times. Seems reasonable to mark this as fixed. The actual fix is in STS4: b19c16c
Activity
martinlippert commentedon Dec 14, 2022
Thanks @w6et for reporting this, the language server is probably loading the OpenRewrite recipes nevertheless the preference is disabled - and therefore doesn't need to do that. We should change that.
But the activity should really happen just once and not multiple times. Do you see this progress view entry multiple times? And do they run for a very long time (or even all the time)? Or do they disappear from the progress view again?
w6et commentedon Dec 14, 2022
@martinlippert yes,happen multiple times, and highly increased memory consumption together.
I'm not sure how to trigger languageServer ,I guess(looks like by Progress view)
when javaSourceWindow hang or other else,started timeout,so languageServer has been launched multiple times.
gbaso commentedon Dec 14, 2022
Same here, Eclipse is unusable due to this. Constantly freezes due to dozens of (hanging) background jobs and has to be force-killed.
BoykoAlex commentedon Dec 14, 2022
@w6et @gbaso I'd like to check if there are more than one language server started in these case or is it just the progress that is never terminated.
II wonder if you could try the following:
jpscommand executed from the terminal does not haveBootLanguageServerBootAppin the list of java processes.jpscommand again and take a note of how manyBootLanguageServerBootAppare there. Wait 30 sec and runjpsagain, check if number ofBootLanguageServerBootApphas changed.Also, I'm curious whether you are seeing multiple Loading Rewrite Recipes jobs at startup of STS or eventually after working in STS for some time. Do you recall performing changes to maven pom or gradle build files right before seeing those rogue jobs?
martinlippert commentedon Dec 14, 2022
@w6et @gbaso Can you also enable the preference to push the logs from the Spring Boot language server via:
Preferences -> Language Servers -> Spring Language Servers, then activate theSpring Bootentry, then retry the IDE. From there on, the log from the language server process appears in your Console view. Maybe you can paste the content of that log output while those problems appear that you describe?In addition to that it would also be interesting to see if the problem completely goes away if you disable the Spring Boot language server altogether from the
Preferences -> Language Serverslist for all the file associations.65 remaining items
youcangetme commentedon May 8, 2023
mega-metadata.zip
Well, this is with the new snapshot so hopefully you have usable logs.
BoykoAlex commentedon May 8, 2023
Looks to me like the issue has two parts to it.
Part One.
The Boot LS process sometimes doesn't start normally. There is no logging info for this as logging didn't seem to start in this case at all.
For example Eclipse side logging is:
There is no matching log entries on the LS side (no entries at 22:39:47 and 22:39:48):
Therefore timeouts for this:
as nothing has been received from the language server at all, however, the process seem to have started...
Part Two
Attempt to start the second language server while the first one is either stuck or being initialized or just slow. The attempt to start the second language server comes from the fact that the check whether currently started LS can work on a document from one of the projects in the workspace returns
false, hence the same definition language server is being started.The check would start returning
trueif server was marked assingleton.Another instance of starting the same boot LS can be initiated from the
LanguageServerWrapper#start()method if comm pipe has been closed (failed LS process start i suppose). This re-start is valid though...I'd try to limit Boot LS t only one process/LS wrapper properly by setting
singletonproperty in the extension point: b19c16c Should be available in the next snapshot build of STS4 for Eclipse. Will post here once available.Also logging adjusted for lsp4e:
repository-0.13.1-SNAPSHOT.zip
BoykoAlex commentedon May 9, 2023
@youcangetme should be ok to install snapshot of sts4 for eclipse from an nightly/snapshot update site found on this page: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html
Combined with lsp4e from the comment above, please, give it another try. The change in STS4 has chances to fix the issue... but lets wait until you try it out.
youcangetme commentedon May 9, 2023
Ok, logs reset and everything installed and updated.
BoykoAlex commentedon May 12, 2023
@youcangetme how's it going with the new sts4 snapshot and a modified lsp4e? Have you been busy and not had time to watch this stuff or is it just working now? :-)
CyberRookie commentedon May 12, 2023
youcangetme commentedon May 14, 2023
Hmmmm, I have not seen the language server go nuts on any machine with the new patches installed. I am wary to pronounce it "fixed." But I am willing to say (while knocking on wood) "sure, give it prime time exposure and see."
youcangetme commentedon May 16, 2023
I still haven't seen anything bad yet and I have been banging on it pretty darn hard.
BoykoAlex commentedon May 16, 2023
@youcangetme could you please attach your logs (eclipse and boot ls) from these few past days? Are STS tools working though? Do you see content assists in boot properties files, spring symbols showing up after Ctrl-6, etc?
I think the singleton property for the LS extension point is the real fix to the problem... Stuff that went into LSP4E is mostly for logging... Thus if at some point you switch to just the snapshot distro of STS4 it should work just as well ideally.
youcangetme commentedon May 18, 2023
Sorry I missed your message. I will upload the logs in the morning.
youcangetme commentedon May 19, 2023
metadata.zip
This one seems awfully small. Sorry for the delay.
BoykoAlex commentedon May 23, 2023
@youcangetme I have gone through the logs and it seems fixed to me - only one Boot LS at all times. Seems reasonable to mark this as fixed. The actual fix is in STS4: b19c16c
martinlippert commentedon May 23, 2023
Thank you both @BoykoAlex and @youcangetme for your work on this, your patience, and your relentless drive to solve this. Very very much appreciated.
youcangetme commentedon Jun 2, 2023
@martinlippert glad to help. Everything continues to work as expected so I am changing back to the regular distro to keep in sync with my developers.