Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
whisperity opened this issue Mar 26, 2024 · 0 comments

Comments

@whisperity
Copy link
Member

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant