Skip to content

Add a db_cleanup routine that updates the cached CONFIG.products.num_of_runs to the actual, sensible, value #4199

@whisperity

Description

@whisperity

As of CodeChecker 6.23, the following nonsense can appear for long-running servers. The underlying reason is so far unclear, which makes it non-trivial to fix, but we could at least temporarily treat the symptoms at every server restart if a db_cleanup routine was added that updates the value cached in the CONFIG database under products.num_of_runs to the real value of COUNT(runs.id) in the PRODUCT database.

A snippet of the home page showing a negative number of runs.

Warning

In the post-#4171 world, care must be taken that this calculation and update can not be executed in parallel and must be sequenced after the per-product db_cleanup.


Tip

We should also consider that this calculation could be updated not just every time a server restarts, but every time the details of a product are queried. In case we detect that there is a negative number of runs, we could defer to a "cold path" where the calculation of the actual number of runs is performed, and the database is updated. (While more expensive, the trade-off is that we will never actually give the user back a nonsense.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions