Understanding the CFamily cache

hi @Abbas ,
We are facing similar issues with cache mechanism when used in PR pipelines,
When ran same PR two consecutive times,
First build → takes 40 mins to scan (no cache hits)
Second build → takes 3-5 mins to scan (hits cache for almost all the files)

But if there was any other PR build ran in between these then again no cache hits and full cache is regenerated, takes 40 mins time.

Since you have mentioned about the paths above ? Do they need to match for each PR build ? if not, cache is invalid ?

As of now all our PR build workspaces are created uniquely based on PR number.

We are working with Sonarqube 9.4.0 (I know that there is analysis change in 9.7 but I am not sure if this behavior will change even when upgraded)

Thanks in advance.

1 Like

Hi @rgaduputi,

I moved your question to a separate thread because they are pretty different.

  • SQ 9.4 CFamily supports CFamily filesystem cache that you control (You control where to store it and when to update it). The cache is based on the files’ absolute paths.
  • SQ 9.5 supports server-side cache. It is enabled by default, and you don’t have to configure it. The filesystem cache is still available for finer control
  • SQ 9.6 introduce support for project-location independent cache for both filesystem and server cache.
  • If your project build settings change between the PR, this naturally invalidates parts of the cache as build settings impact the analysis.

I hope it is clearer now.


Thank you @Abbas for clarification.

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