Skip to content

remove guava from jooby#205

Open
xsalefter wants to merge 34 commits into
masterfrom
java2x
Open

remove guava from jooby#205
xsalefter wants to merge 34 commits into
masterfrom
java2x

Conversation

@xsalefter

@xsalefter xsalefter commented May 8, 2026

Copy link
Copy Markdown
Contributor

This PR include fix for this issue, and include few fixes for more problem during javax to jakarta migration:

  • .github/workflows/release.yml use latest actions/<XXX> : 5b5f728
  • Netty commons required during redis testing : b7f5514
  • Remove Guava completely from Jooby, that started from this commit: 82a8391
  • Use caffeine as cache implementation (previous ConccurentCache work deleted) : 0bcf7aa
  • Introduce CacheBuilder#weakKeys() to be used in SubscriberRegistry : a360877

Copilot AI and others added 30 commits May 9, 2026 01:07
…n properties and targetJdk

Agent-Logs-Url: https://github.com/killbill/killbill-commons/sessions/0cd0a140-7cb2-4780-9385-7e0741ebdf50

Co-authored-by: xsalefter <510438+xsalefter@users.noreply.github.com>
Replace computeIfAbsent-based load coalescing with an external ConcurrentHashMap<K, CompletableFuture<V>> in-flight map.

Previous approach use user-supplied loader inside the ConcurrentHashMap mapping function, which holds a bin-level lock during computation. This has two problems for a general-purpose cache API:
  - A slow loader blocks all map operations for keys in the same bin
  - A loader that calls back into the same cache can deadlock on ConcurrentHashMap

The new approach:
  1. Atomically putIfAbsent a CompletableFuture into the in-flight map
  2. The winning thread runs the loader with no locks held
  3. Losing threads join() the existing future
  4. CompletionException is unwrapped so all callers see the same exception type regardless of whether they were the loader or waiter
  5. remove(key, fresh) in finally ensures only the owning future is cleaned up, preventing accidental clobber of a concurrent reload

Coalescing semantics are preserved: concurrent cold misses for the same key still trigger exactly one loader invocation.
completely remove guava related classes and use caffeine backed cache
@xsalefter xsalefter changed the title First PR to use killbill-oss-parent:0.147.0 remove guava from jooby Jun 5, 2026
@xsalefter xsalefter marked this pull request as ready for review June 5, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants