SonarQube checking for PENDING analyses

SonarQube Version 8.9.0.43852
Official Docker container sonarqube:lts-community
PostgreSQL 10 (AWS Aurora PostgreSQL)

The issue:
SonarQube makes connection to database server every 2 seconds submitting following queries:

select cq.uuid

    from
      ce_queue cq

    where
      cq.status='PENDING'
      and cq.started_at is null

        and cq.task_type <> 'ISSUE_SYNC'

      and not exists (
        select
          1
        from
          ce_queue cq2
        where
          cq.main_component_uuid=cq2.main_component_uuid
          and cq2.status <> 'PENDING'
      )


    order by
      cq.created_at asc,
      cq.uuid asc

and

select cq.uuid

    from
      ce_queue cq

        left join components c on c.uuid = cq.main_component_uuid and c.qualifier <> 'VW'

    where
      cq.status='PENDING'
      and cq.started_at is null

      and not exists (
        select
          1
        from
          ce_queue cq2
        where
          cq.main_component_uuid=cq2.main_component_uuid
          and cq2.status <> 'PENDING'
      )


    order by
      cq.created_at asc,
      cq.uuid asc

I am guessing those are to check for pending analyses. However, this results in constant activity on database server. We use Serverless Aurora and run code analysis once a week, and we would like our Aurora PostgreSQL pause when it is not used. This (pause) happens after 5 min of no activity, but since SonarQube makes above queries every 2 seconds, pause never happens and we incur AWS costs.

Can above checks frequency be configurable, please?
Or is there a way to make them less frequent? Like once a day?

Thanks!

Hi @PawelZ-RD,

Welcome to the SonarSource Community!!

The Compute Engine(aka ce) is responsible for connections to the database. Unfortunately, changes to the compute engine performance are only available in our Enterprise Edition.

Regards,

Megan

EDIT: Actually, I’ll check on this internally. The comment I made wouldn’t be relevant in this situation.

Hi @PawelZ-RD,

I am not able to find a way to limit the number of requests to the database in our product currently. I have shared this feature insight with our product management team.

Thanks so much,

Megan

Hi @Megan

Thanks for looking into this issue.
It would be great if polling frequency was added as configurable property.

Thanks!
Pawel

Hi @PawelZ-RD,

I got a response back from the product management team, and they wanted a bit more information on the use case. Why do you only run the analysis only once a week? Typically we expect you to run an analysis every time you commit code, following the Clean as you Code methodology.

Also, have you considered moving to SonarCloud since you are relying on AWS services?

Thanks so much,

Megan

2 Likes

Hi @Megan

Our Development team believe that weekly runs are most helpful for them.
As for SonarCloud, with over 1M lines of code, this would be too costly.

Regards,
Pawel