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.
[!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.)
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 underproducts.num_of_runs
to the real value ofCOUNT(runs.id)
in the PRODUCT database.