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

Task failure swallowed if the task can't be found in CE_QUEUE when finalizing it

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.2.1, 7.3
    • Fix Version/s: 7.4
    • Component/s: Compute Engine
    • Labels:
    • Edition:
      Community
    • Production Notes:
      None

      Description

      When task is finalized, it the task has been removed from CE_QUEUE table, the task processing fails with an error such as the following:

      2018.08.10 09:39:04 ERROR ce[AWUivd7E_FqmvmGLngw9][o.s.c.t.CeWorkerImpl] Failed to finalize task with uuid 'AWUivd7E_FqmvmGLngw9' and persist its state to db
      java.lang.IllegalStateException: Task does not exist anymore: CeTask{organizationUuid=AWRLjx0a4xgTNfdfoqA1, type=REPORT, uuid=AWUivd7E_FqmvmGLngw9, componentUuid=AWRZ_2MXMhGhoHR5vrwa, componentKey=cdq.cdl:cdl, componentName=corporate-data-league, submitterUuid=AWRLhNwhMhGhoHR5vm6M}
      	at org.sonar.ce.queue.InternalCeQueueImpl.lambda$remove$0(InternalCeQueueImpl.java:105)
      	at java.util.Optional.orElseThrow(Optional.java:290)
      	at org.sonar.ce.queue.InternalCeQueueImpl.remove(InternalCeQueueImpl.java:105)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.finalizeTask(CeWorkerImpl.java:166)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:149)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:98)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(CeWorkerImpl.java:82)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:74)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:44)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      From the situation when this error occurred in production (see INFRA-2251) and looking at the code, it seems that, if the task failed with an error, then this error is never logged and only the one above is.

        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: