Skip to content

OpenRewrite unchecked, but always Language Server Background Job(Loading Rewrite Recipes) #925

Closed

Description

@w6et

Describe the bug

Version: 4.17.0.RELEASE
when i click "package Explorer" from "java Source Window"
image

Activity

  1. added
    for: eclipse
    for: vscode
    and removed on Dec 14, 2022
  2. added this to the 4.17.1.RELEASE milestone on Dec 14, 2022
  3. martinlippert commented on Dec 14, 2022

    @martinlippert
    Member

    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?

  4. w6et commented on Dec 14, 2022

    @w6et
    Author

    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.
      image
  5. gbaso commented on Dec 14, 2022

    @gbaso

    Same here, Eclipse is unusable due to this. Constantly freezes due to dozens of (hanging) background jobs and has to be force-killed.

  6. BoykoAlex commented on Dec 14, 2022

    @BoykoAlex
    Contributor

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

    1. 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.
    2. 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?

  7. martinlippert commented on Dec 14, 2022

    @martinlippert
    Member

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

  8. 65 remaining items

  9. youcangetme commented on May 8, 2023

    @youcangetme

    mega-metadata.zip

    Well, this is with the new snapshot so hopefully you have usable logs.

  10. BoykoAlex commented on May 8, 2023

    @BoykoAlex
    Contributor

    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:

    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
    
    

    Therefore timeouts for this:

    org.eclipse.lsp4e.LanguageServerWrapper.supportsWorkspaceFolderCapability(LanguageServerWrapper.java:587)
    

    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.

    Also logging adjusted for lsp4e:
    repository-0.13.1-SNAPSHOT.zip

  11. BoykoAlex commented on May 9, 2023

    @BoykoAlex
    Contributor

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

  12. youcangetme commented on May 9, 2023

    @youcangetme

    Ok, logs reset and everything installed and updated.

  13. BoykoAlex commented on May 12, 2023

    @BoykoAlex
    Contributor

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

  14. CyberRookie commented on May 12, 2023

    @CyberRookie
  15. youcangetme commented on May 14, 2023

    @youcangetme

    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."

  16. youcangetme commented on May 16, 2023

    @youcangetme

    I still haven't seen anything bad yet and I have been banging on it pretty darn hard.

  17. BoykoAlex commented on May 16, 2023

    @BoykoAlex
    Contributor

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

  18. youcangetme commented on May 18, 2023

    @youcangetme

    Sorry I missed your message. I will upload the logs in the morning.

  19. youcangetme commented on May 19, 2023

    @youcangetme

    metadata.zip

    This one seems awfully small. Sorry for the delay.

  20. BoykoAlex commented on May 23, 2023

    @BoykoAlex
    Contributor

    @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

  21. martinlippert commented on May 23, 2023

    @martinlippert
    Member

    Thank you both @BoykoAlex and @youcangetme for your work on this, your patience, and your relentless drive to solve this. Very very much appreciated.

  22. youcangetme commented on Jun 2, 2023

    @youcangetme

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: eclipsefor: vscodetheme: performancetheme: refactoringtype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions