Skip to content

LSP functionality stops working very often #592

Closed

Description

@hexa00

When editing code, the LSP functionally stops to works often, sometimes once every 2 minutes.

In the LSP logs I can see:

!ENTRY org.eclipse.jdt.ls.core 1 0 2018-07-18 13:47:53.406
!MESSAGE >> document/didSave

This is the last entry.

I can also do a ps and see the LSP still running:

/usr/lib/jvm/java-8-oracle/bin/java -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -javaagent:/home/a/.vscode/extensions/gabrielbb.vscode-lombok-0.9.4/server/lombok.jar -Xbootclasspath/a:/home/a/.vscode/extensions/gabrielbb.vscode-lombok-0.9.4/server/lombok.jar -jar /home/atremblay/.vscode/extensions/redhat.java-0.28.0/server/plugins/org.eclipse.equinox.launcher_1.5.100.v20180611-1436.jar -configuration /home/atremblay/.vscode/extensions/redhat.java-0.28.0/server/config_linux -data /home/atremblay/.config/Code/User/workspaceStorage/45a4e3cffe2ce93e37ee8055c276153a/redhat.java/jdt_ws

However in the VSCode LSP output I see that it is still trying to reach the LSP:

[Trace - 13:50:54] Sending request 'workspace/executeCommand - (427)'.
Params: {

.

However it seems these never reach the LSP, I see nothing in the logs of the LSP whatever I do.
Also I see a lot of Sending request but no responses there.

In the console log all I see is:

WARN Aborted format on save after 750ms

It's like it has lost communication ?

Environment
  • Operating System: Ubuntu 18.04 (Can repoduce on Arch too)
  • JDK version: 1.8
  • Visual Studio Code version: 1.25.1
  • Java extension version: 0.28.0
Steps To Reproduce
  1. Hard to tell just edit code and it arrives eventually.

Is there a way I could debug this better ?

Activity

  1. hexa00 commented on Jul 18, 2018

    @hexa00
    Author
  2. changed the title [-]Connection to LSP lost ? [/-] [+]LSP functionality stops worker very often[/+] on Jul 18, 2018
  3. changed the title [-]LSP functionality stops worker very often[/-] [+]LSP functionality stops working very often[/+] on Jul 18, 2018
  4. fbricon commented on Jul 18, 2018

    @fbricon
    Collaborator

    can you take a thread dump of the java process when it hangs like that?

  5. hexa00 commented on Jul 18, 2018

    @hexa00
    Author

    threaddump.txt

    ool-1-thread-1" #22 prio=5 os_prio=0 tid=0x00007f046c556800 nid=0x285e waiting on condition [0x00007f042c898000]
       java.lang.Thread.State: WAITING (parking)
            at sun.misc.Unsafe.park(Native Method)
            - parking to wait for  <0x00000000ccab22f0> (a java.util.concurrent.CompletableFuture$Signaller)
            at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
            at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1693)
            at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
            at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1729)
            at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1934)
            at org.eclipse.jdt.ls.core.internal.JavaClientConnection.executeClientCommand(JavaClientConnection.java:81)
            at com.microsoft.java.test.plugin.internal.JavaModelEventProvider.elementChanged(JavaModelEventProvider.java:55)
            at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1735)
            at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
            at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1723)
            at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1556)
    
    

    Looks suspicious ?

  6. hexa00 commented on Jul 18, 2018

    @hexa00
    Author

    Another one
    threaddump2.txt

    Note that to get out of this situation I reload the window and thus create a new lsp.

    The thread dumps you see are ones I took from JSP hanging processes that were not cleaned up after I did reload.

  7. fbricon commented on Jul 18, 2018

    @fbricon
    Collaborator

    Can you try after disabling Microsoft's Java test runner extension?

  8. hexa00 commented on Jul 18, 2018

    @hexa00
    Author

    OK this may take a while since I have less code to write ATM but I will report back asap.

    What makes you think it could be the cause?

  9. fbricon commented on Jul 18, 2018

    @fbricon
    Collaborator

    since com.microsoft.java.test.plugin.internal.JavaModelEventProvider.elementChanged is in the stacktrace, I just want to rule it out

  10. hexa00 commented on Jul 18, 2018

    @hexa00
    Author

    OK

  11. hexa00 commented on Jul 18, 2018

    @hexa00
    Author

    Maybe too soon to tell but I started writing a lot of code to test and it seems to be much better.

  12. hexa00 commented on Jul 19, 2018

    @hexa00
    Author

    After a full day with no problems I think I can confirm the test extension is the culprit.

  13. akaroml commented on Jul 27, 2018

    @akaroml
    Contributor

    microsoft/vscode-java-test#260 logged to track the effort

  14. julianosam commented on Aug 5, 2018

    @julianosam

    Hey @hexa00 how did you disable the Test Runner extension only? I am trying to disable or even uninstall it but vscode won't let me. The only way is if I remove the entire extension pack.

  15. hexa00 commented on Aug 5, 2018

    @hexa00
    Author

    @julianosam that's what I did I removed the extension pack and reinstalled them separately :)

  16. yaohaizh commented on Sep 10, 2018

    @yaohaizh
    Collaborator

    Close this as it is tracked by vscode java tester.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions