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

ben-manes / caffeine / #3504
100%

Build:
DEFAULT BRANCH: master
Ran 05 Feb 2023 04:57AM UTC
Jobs 1
Files 77
Run time 30s
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

pending completion
#3504

push

github-actions

ben-manes
do not dedupe explicit refreshes if the entry is pending eviction

LoadingCache.refresh(k) returns the in-flight future through the refresh
mapping. While in-flight a subsequent call will return the same future to
avoid unnecessary duplicate requests. If the entry is removed then the
mapping is discarded and the future forwards the results to the removal
listener, which allows for linearizable expectations.

However, if the entry was eligible for eviction (expired or weak/soft GC'd)
but not yet removed, then the in-flight refresh was not yet discarded. While
a lookup would treat it as a miss and reload, a refresh would return this
stale future and no-op. The impact is minor as data consistency remains and
the refresh call does not act as a prefetch. This scenario is now checked for
so the stale future is discarded immediately, a new load is performed, and the
caller receives that future instance.

When reviewing the logic and tests, a subtle change was made to the removal
listener notification. Previously when the refresh was invalidated due to the
entry being removed while in-flight, the future value was sometimes
communicated as the "replace" cause. Since the mapping is absent it was removed
and not replaced, now we now send the "explicit" cause. The original removal
is still its own cause (explicit, size, expired, etc) and here explicit implies
the user's expectation of linearization for their optimistic reload.

These tests also uncovered a small bug in a assertion utility that was too lax,
which led to minor mistakes in various tests.

7482 of 7573 relevant lines covered (98.8%)

0.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #3504.1 05 Feb 2023 04:57AM UTC 0
98.8
Source Files on build #3504
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #3504
  • fae5c5aa on github
  • Prev Build on master
  • Next Build on master
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