-
Notifications
You must be signed in to change notification settings - Fork 872
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
Remove caffeine from instrumentation-api to make it work on Android #4532
Comments
Realized that if we would switch implementations in the javaagent anyways how about just going with an SPI? It could default to non-caffeine and just require adding an artifact to activate, even for library instrumentation |
But that cache does not support weak keys, is it ok for us? @anuraaga ? |
@iNikem I think the idea was to not use bounded caches with weak keys anymore, so always use the WeakLockFree map. Do we have any bounded ones where removing the bound seems like it would cause a problem? |
Now I am even more confused :D This ticket says to use concurrentlinkedhashmap, you are saying to use existing WeakLockFree, meeting notes from the last week say use concurrentlinkedhashmap or cache2k. If we move Caffeine behind SPI, what will be our default cache implementation for library instrumentations? Can we get that consensus? :) |
Think we might have missed it from the notes, but I think wanted to split the entrypoint into two
Always use WeakLockFree for latter, use either ConcurrentLinkedHashMap (or maybe cache2k) or Caffeine based on an SPI for former. I guess the default for library instrumentation bounded cache would be ConcurrentLinkedHashMap since including is a bit simpler than excluding. |
So we want 3 cache implementations?? |
I think we want two types of cache:
So 2 different interfaces/APIs basically. |
Implemented in #4667 |
Is your feature request related to a problem? Please describe.
Caffeine doesn't work on Android, using it will break library instrumentations (like okhttp3) that are supposed to be used on Android.
Animalsniffer detects a lot of classes in caffeine2 that are not present in android: #4505
Describe the solution you'd like
The current idea to solve this issue is to vendor in https://github.com/ben-manes/concurrentlinkedhashmap and move caffeine 2 & 3 to agent bootstrap -- so that when the javaagent is used the optimal cache implementation is chosen.
The text was updated successfully, but these errors were encountered: