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

[RC] Use Guava instead of Caffeine caches for Android #2483

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ellisjoe
Copy link
Contributor

@ellisjoe ellisjoe commented Jan 30, 2025

Before this PR

Caffeine caches run into issues when running on Android, minimally related to its usage of java.lang.System$Logger which isn't present.

After this PR

Swap over to using Guava caches which should be fully compatible on Android devices.
==COMMIT_MSG==

==COMMIT_MSG==

Possible downsides?

Ideally this change would be done in a way where we pick Caffeine caches when running on standard JVMs and Guava caches when running on Android devices.

Comment on lines -96 to -97
private static final LoadingCache<String, MaybeUri> uriCache = CacheStats.of(
SharedTaggedMetricRegistries.getSingleton(), "dialogue-uri")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've dropped this instrumentation since we don't have a 1-1 replacement using the same timeseries names for guava caches. If this unblocks android stuff and we move forward, we can look into adding some guava cache utility functionality.

@ellisjoe ellisjoe force-pushed the jellis/guava-caches branch from f093736 to 4cbd124 Compare January 30, 2025 17:47
reduce coupling to caffeine in favor of guava

We generally prefer caffeine caches, however they have compatibility
issues with graalvm-native as well as android codebases.

replace missed caches, drop some instrumentation
@ellisjoe ellisjoe force-pushed the jellis/guava-caches branch from 4cbd124 to e103e7d Compare January 30, 2025 17:49
@carterkozak carterkozak marked this pull request as draft January 30, 2025 17:51
carterkozak
carterkozak previously approved these changes Jan 30, 2025
Copy link
Contributor

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to create an RC release for testing on Android

@policy-bot policy-bot bot dismissed carterkozak’s stale review January 30, 2025 17:52

Invalidated by push of 5ce0515

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

Successfully merging this pull request may close these issues.

3 participants