SonarQube Background Tasks Que

Must-share information (formatted with Markdown):

  • SonarQube 8.9 LTS
  • Get the QA gateway results back to Jenkins in proper time
  • Increase timeout value at Jenkins pipeline.

We are using Jenkins for the automation of the process. But sometime it takes more than 20minutes to get success return from SonarQube. When we check background tasks we noticed most of the time is spent at que.

This is from a task:
Submitted : 2:31:10 AM
Started : 2:47:49 AM
Finished : 2:47:59 AM

Also Backgroun task search is not working as expected. If we search by time frame we can’t see the task. To see the task, we need to specify exact test ID.

Do you have any suggestion on this?

Hello,

How was the activity in your background task queue between 2:31:10 and 2:47:49? Maybe SonarQube had a lot of background tasks to process, in this case, the queue behaviour works as expected: SonarQube was actually just busy processing the queue.

Actually that is one of the problems. As I said if I filter background tasks using the “Date” selector, it is showing me the task in just ~2hrs time frame.
If I could see somehow all tasks I thought I could find some other tasks taking too much. As far as I know background tasks does not take that long, top I saw is 2min.

TBH, I gave up using web interface to find out.

Is there a way to extract that data, maybe some SQL query?

Here is the SQL query for this.

SELECT uuid,
       submitter_uuid,
       To_timestamp(submitted_at / 1000) AS submitted_at,
       To_timestamp(started_at / 1000)   AS started_at,
       To_timestamp(executed_at / 1000)  AS executed_at,
       execution_time_ms
FROM   ce_activity
WHERE  submitted_at > '1634169600000'
       AND submitted_at < '1634256000000'
-- unix timestamp
ORDER  BY submitted_at ASC; 

And it looks like SQ (Enterprise only) has option to increase background task agent. After increasing to two we saw significant improvement.

But my comment is still stand, background tasks search gui is I will call it “ugly”.

Hey, thanks for taking the time to get back to us with the information that increasing the worker count improved the situation.

About the background task UI, could you please summarise what improvements you suggest?

@pierreguillot I think a simple export as csv would help a lot.
Specify date range including hour, minute and seconds and hit export.
Export columns could be same in background tasks page.

PS: I am doing the export via SQL dump right now, rest is on Excel some fancy graphs etc.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.