• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ben-manes / caffeine / #5552
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: v3.dev
DEFAULT BRANCH: master
Ran 27 Jun 2026 05:35PM UTC
Jobs 1
Files 78
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Jun 2026 04:57PM UTC coverage: 99.988% (-0.01%) from 100.0%
#5552

push

github

ben-manes
discard an in-flight refresh on the put insert path

The put() insert was the only write path that didn't clear an in-flight
refresh token, so an explicit refresh() on an absent key could linger in
`refreshes` after a concurrent insert and suppress later refreshes until
it completed. The insert now discards inside data.computeIfAbsent's
lambda -- under the bin lock, no node monitor -- so it wins like the
update and remove paths. The overwrite the audit reported was a false
positive: the refresh completion guards already reject a stale reload, so
this is a consistency fix, not a correctness one.

The discard must run inside the CHM lambda, never under synchronized(node)
across putIfAbsent: putIfAbsent locks bin heads internally for both the
link and a follow-on resize (addCount -> transfer, after the node is
visible), so holding the node monitor across it is a node-before-bin
acquisition that deadlocks a concurrent computeIfPresent remove. The
synchronized variant shipped and was reverted after MultiThreadedTest
deadlocked; documented in synchronization.md.

Also re-check node.isAlive() in refreshIfNeeded's registration lambda so
a node retired between the gate snapshot and the lambda doesn't launch a
doomed reload.

Tests: RefreshAfterWriteTest.put_insert_discardsRefresh,
BoundedLocalCacheTest.refreshIfNeeded_retiredAfterSnapshot. Also folds in
minor dependency and build/CI bumps (dependency-analysis, javapoet, etc.).

4050 of 4056 branches covered (99.85%)

10 of 10 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

8244 of 8245 relevant lines covered (99.99%)

1.0 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
98.0
-2.0% caffeine/src/main/java/com/github/benmanes/caffeine/cache/Interner.java
Jobs
ID Job ID Ran Files Coverage
1 #5552.1 27 Jun 2026 05:35PM UTC 78
99.99
Source Files on build #5552
  • Tree
  • List 78
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • bb910b77 on github
  • Prev Build on master
  • Next Build on v3.dev
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc