-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix Hibernate cache random failures #694 #710
Conversation
* Caffeine offers no strict guarantees on which entity is evicted. Once the max is reached, there's no strict guarantees on which entity will be evicted, so we can't really to try to deterministically choose an entity to query after it's been evicted. * Caffeine is not strict in its max size, it can run over for a little. * Fix incorrect conversion from seconds to nanoseconds.
I'll wait until CI but I don't think this is fully fixed. Native image testing locally just threw:
|
I'll wait until CI finishes and then close the PR, I've found another issue :) |
* PutFromLoadValidator compares expiration timeouts with region timestamps, which are provided in milliseconds. * Caffeine works with nanoseconds, so max idle timeouts should be converted into nanoseconds. * Empty VersionedEntry instances are tombstones, whose tomsbtone lifespan should be defined in nanoseconds so that Caffeine can evict it appropiately.
Added a new commit that should fix any pending failures. Essentially, different parts of the Hibernate cache logic work with different units. These units are mandated by Hibernate cache SPI and Caffeine respectively and crucially they're in different units. Hibernate cache SPI defines next region timestamp in milliseconds while Caffeine works with nanoseconds. |
Looks nice, and worked locally. Waiting for CI to finish. |
Maybe we want to get rid of the "shit happened" bit at some point :) |
Copy pasted that from somewhere else... 🙈 |
Once the max is reached, there's no strict guarantees on which
entity will be evicted, so we can't really to try to deterministically
choose an entity to query after it's been evicted.