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
Explore removing Caffeine's UnsafeRefArrayAccess #25125
Comments
This could be a good task for anyone getting started with tacking native issues. Happy to help with any obstacles encountered. |
I'd love to help if you don't mind. |
Hi @galderz,
|
@galderz silly question :) is it a public chat group? |
Yes, anyone can join. Just like Quarkus' Zulip server. |
It seems we're going to have to postpone this temporarily. Infinispan's baseline is still Java 8 and Caffeine 3 needs Java 11. Technically, the error above is a runtime error, so if Infinispan can somehow avoid the binary compatibility, the upgrade would still be doable. They're on Caffeine 2.8.x, which is too old to solve this problem. They need at least Caffeine 2.9.x to attempt to workaround the binary compatibility. More details in Zulip discussion linked in earlier comment. |
Just a note: Infinispan This still needs to wait for a proper release and us upgrading though. |
/cc @gwenneg |
infinispan/infinispan@88cfbf1 will be available with Infinispan 14.0.0 which hasn't been released yet. The |
Quarkus is now using Infinispan |
Description
While doing some research, I've discovered that Caffeine is no longer using Unsafe. In ben-manes/caffeine@e4b77d2, Caffeine moved its copy of
MpscGrowableArrayQueue
to use either Unsafe, or if not available, VarHandle. Then, with ben-manes/caffeine@4db9e8e, Unsafe was completely removed and VarHandle is only in use.This means that
UnsafeRefArrayAccess
should no longer be needed. I'm not aware of VarHandles requiring extra handling.Implementation ideas
Upgrade to a Caffeine version that includes the 2 commits mentioned above. The minimum version that includes both is
3.0.2
. At the time of writing, the latest version is3.0.6
.Then, remove
UnsafeRefArrayAccess
and see if Caffeine dependant native CI tests fail.When
UnsafeRefArrayAccess
was not in place, you'd get a segmentation fault during runtime native execution, as a result of native offset that is runtime dependant being wrongly baked at build time.The text was updated successfully, but these errors were encountered: