Uploaded image for project: 'SonarLint Core Library'
  1. SonarLint Core Library
  2. SLCORE-335

Dead lock in ProgressReport

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.3
    • Component/s: Core
    • Labels:
      None

      Description

      I managed to have an analysis stuck forever. Here is the interesting part of the thread dump:

      "ApplicationImpl pooled thread 47" #158 daemon prio=4 os_prio=0 cpu=3642,55ms elapsed=1091,18s tid=0x00007fe3a1b5b800 nid=0x78d2 in Object.wait()  [0x00007fe2aae99000]
         java.lang.Thread.State: WAITING (on object monitor)
              at java.lang.Object.wait(java.base@11.0.7/Native Method)
              - waiting on <no object reference available>
              at java.lang.Thread.join(java.base@11.0.7/Thread.java:1305)
              - waiting to re-lock in wait() <0x000000008ad568e0> (a java.lang.Thread)
              at java.lang.Thread.join(java.base@11.0.7/Thread.java:1379)
              at org.sonarsource.sonarlint.core.util.ProgressReport.stop(ProgressReport.java:69)
              at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileIndexer.index(FileIndexer.java:84)
              at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:132)
              at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:126)
              at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:111)
              at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
              at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:84)
              at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:148)
              at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl$$Lambda$2828/0x0000000101b89c40.apply(Unknown Source)
              at org.sonarsource.sonarlint.core.AbstractSonarLintEngine.withModule(AbstractSonarLintEngine.java:87)
              at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$1(ConnectedSonarLintEngineImpl.java:146)
              at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl$$Lambda$2827/0x0000000101b89840.get(Unknown Source)
              at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:336)
              at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:326)
              at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:144)
              at org.sonarlint.intellij.core.ConnectedSonarLintFacade.analyze(ConnectedSonarLintFacade.java:73)
              at org.sonarlint.intellij.core.SonarLintFacade.startAnalysis(SonarLintFacade.java:63)
              - locked <0x000000008adba300> (a org.sonarlint.intellij.core.ConnectedSonarLintFacade)
              at org.sonarlint.intellij.analysis.SonarLintAnalyzer.analyzeModule(SonarLintAnalyzer.java:89)
              at org.sonarlint.intellij.analysis.AnalysisTask.analyzePerModule(AnalysisTask.java:392)
              at org.sonarlint.intellij.analysis.AnalysisTask.run(AnalysisTask.java:157)
              at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:932)
              at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:434)
              at com.intellij.openapi.progress.impl.CoreProgressManager$$Lambda$1509/0x00000001013c3840.apply(Unknown Source)
              at com.intellij.openapi.progress.impl.ProgressRunner.lambda$null$3(ProgressRunner.java:233)
              at com.intellij.openapi.progress.impl.ProgressRunner$$Lambda$965/0x0000000100f1c040.run(Unknown Source)
              at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:166)
              at com.intellij.openapi.progress.impl.CoreProgressManager$$Lambda$283/0x0000000100435440.run(Unknown Source)
              at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
              at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
              at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
              at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:153)
              at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:233)
              at com.intellij.openapi.progress.impl.ProgressRunner$$Lambda$961/0x0000000100f1d040.get(Unknown Source)
              at java.util.concurrent.CompletableFuture$AsyncSupply.run(java.base@11.0.7/CompletableFuture.java:1700)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.7/ThreadPoolExecutor.java:1128)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.7/ThreadPoolExecutor.java:628)
              at java.lang.Thread.run(java.base@11.0.7/Thread.java:834)
      
         Locked ownable synchronizers:
              - <0x00000000832bd658> (a java.util.concurrent.ThreadPoolExecutor$Worker)
      
      "Report about progress of file indexation" #175 daemon prio=4 os_prio=0 cpu=355,09ms elapsed=1029,30s tid=0x00007fe3b423d800 nid=0x791d waiting on condition  [0x00007fe320fad000]
         java.lang.Thread.State: TIMED_WAITING (sleeping)
              at java.lang.Thread.sleep(java.base@11.0.7/Native Method)
              at org.sonarsource.sonarlint.core.util.ProgressReport.run(ProgressReport.java:45)
              at java.lang.Thread.run(java.base@11.0.7/Thread.java:834)
      
         Locked ownable synchronizers:
              - None
      
      

      I'm not really sure how this is possible to end up in this state. The stop method should set the interrupted flag, and then the run method should check it at least every 10s.
      One possibility would be for the interrupted flag to have been reset. I can imagine that if the interruption is triggered in the log method, and something inside catch the InterruptedException without setting the flag back, this could create the bug.

        Attachments

          Activity

            People

            Assignee:
            julien.henry Julien Henry
            Reporter:
            julien.henry Julien Henry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: