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

Cache configuration checks should consider negative values for NumCounters/MaxCost/BufferItems #378

Closed
ankon opened this issue Apr 12, 2024 · 3 comments
Labels

Comments

@ankon
Copy link

ankon commented Apr 12, 2024

Found while reading through the code:
https://github.com/dgraph-io/ristretto/blob/c67e07994f911dbf42104f568c83a29830e88236/cache.go#L169-L174

The checks are fine, but given that these are int64s they could be <0 which the checks won't catch unless I'm missing something.

Copy link

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

@github-actions github-actions bot added the Stale label Jul 12, 2024
@zhaohaihang
Copy link
Contributor

I also think that the aforementioned variables should be set to be greater than 0. Because if the aforementioned variables are less than 0, it will cause the program to fail. Since we're already performing checks, why not do it even better?

zhaohaihang pushed a commit to zhaohaihang/ristretto that referenced this issue Oct 28, 2024
zhaohaihang pushed a commit to zhaohaihang/ristretto that referenced this issue Oct 29, 2024
@mangalaman93
Copy link
Member

Fixed by #410

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

No branches or pull requests

3 participants