Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7060

Compute Engine starts processing pending tasks at restart before Views/DevCockpit are bootstrapped

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2, 5.3
    • Fix Version/s: 5.3
    • Component/s: None
    • Labels:
      None

      Description

      When SonarQube is restarted and the Compute Engine is not empty, the not yet processed (or unfinished) task in the Compute Engine queue will be processed automatically.

      The problem is, this processing starts too early and plugins (such as Views and DevCockpit) are not yet loaded/started which causes tasks failures.

      easy (but slow) reproducer: start SQ on a Dory DB, launch views or devcockpit refresh, stop SQ before all views/developers are refreshed, scratch ES index, start SQ

      Extract from sonar.log:

      2015.11.23 12:29:05 INFO   es[o.e.cluster.metadata]  [sonar-1448278136937] [issues] create_mapping [authorization]
      2015.11.23 12:29:05 INFO  web[o.s.s.e.IndexCreator] Create type issues/issue
      2015.11.23 12:29:05 INFO   es[o.e.cluster.metadata]  [sonar-1448278136937] [issues] create_mapping [issue]
      2015.11.23 12:29:05 INFO  web[o.s.s.e.IndexCreator] Create index users
      2015.11.23 12:29:05 INFO   es[o.e.cluster.metadata]  [sonar-1448278136937] [users] creating index, cause [api], templates [], shards [5]/[0], mappings []
      2015.11.23 12:29:05 INFO  web[o.s.s.e.IndexCreator] Create type users/user
      2015.11.23 12:29:05 INFO   es[o.e.cluster.metadata]  [sonar-1448278136937] [users] create_mapping [user]
      2015.11.23 12:29:05 INFO  web[o.s.s.e.IndexCreator] Create index views
      2015.11.23 12:29:05 INFO   es[o.e.cluster.metadata]  [sonar-1448278136937] [views] creating index, cause [api], templates [], shards [5]/[0], mappings []
      2015.11.23 12:29:05 INFO  web[o.s.s.e.IndexCreator] Create type views/view
      2015.11.23 12:29:05 INFO   es[o.e.cluster.metadata]  [sonar-1448278136937] [views] create_mapping [view]
      2015.11.23 12:29:05 INFO  web[o.s.s.n.NotificationService] Notification service started (delay 60 sec.)
      2015.11.23 12:29:05 INFO  web[o.s.s.c.t.CeWorkerRunnableImpl] Execute task | project=DEV:stas@stas-macbook-pro.local | id=AVEz5fkyDhcXDtIw2TVu
      2015.11.23 12:29:05 ERROR web[o.s.s.c.t.CeWorkerRunnableImpl] Executed task | project=DEV:stas@stas-macbook-pro.local | id=AVEz5fkyDhcXDtIw2TVu | time=14ms
      

      content of AVEz5fkyDhcXDtIw2TVu.log:

      2015.11.23 12:29:05 INFO  [o.s.s.c.t.CeWorkerRunnableImpl] Execute task | project=DEV:stas@stas-macbook-pro.local | id=AVEz5fkyDhcXDtIw2TVu
      2015.11.23 12:29:05 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Failed to execute task AVEz5fkyDhcXDtIw2TVu
      java.lang.IllegalStateException: Method startDevCockpit has not been called. Developer Cockpit is not ready
              at com.google.common.base.Preconditions.checkState(Preconditions.java:176) ~[guava-17.0.jar:na]
              at com.sonarsource.devcockpit.DevCockpitBridgeImpl.checkInitialized(DevCockpitBridgeImpl.java:56) ~[na:na]
              at com.sonarsource.devcockpit.DevCockpitBridgeImpl.getDevRefreshTaskProcessor(DevCockpitBridgeImpl.java:51) ~[na:na]
              at com.sonarsource.devcockpit.ce.taskprocessor.DevCockpitCeTaskProcessor.process(DevCockpitCeTaskProcessor.java:48) ~[na:na]
              at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.executeTask(CeWorkerRunnableImpl.java:78) [sonar-server-5.3-SNAPSHOT.jar:na]
              at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.run(CeWorkerRunnableImpl.java:55) [sonar-server-5.3-SNAPSHOT.jar:na]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_40]
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_40]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_40]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_40]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_40]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_40]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
      2015.11.23 12:29:05 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Executed task | project=DEV:stas@stas-macbook-pro.local | id=AVEz5fkyDhcXDtIw2TVu | time=13ms
      

        Attachments

          Activity

            People

            Assignee:
            sebastien.lesaint Sebastien Lesaint
            Reporter:
            sebastien.lesaint Sebastien Lesaint
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: