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

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

Build:
Build:
LAST BUILD BRANCH: v3.dev
DEFAULT BRANCH: master
Ran 25 May 2022 05:03AM UTC
Jobs 1
Files 77
Run time 23s
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
#3086

push

github-actions

ben-manes
Less aggressive discard on conflict for  AsyncCache's refreshes (fixes #714)

Linearization means that the refresh should be dropped if another write
for that entry occurs, as we may populate the cache with stale data. The
cache uses a write timestamp to help detect this. However, when this
could be too aggressive when a refresh runs concurrently with the async
load completing.

An inflight load is given an infinite timestamp so that it never expires.
A whenComplete callback then updates the entry with its policy metadata,
such as its expiration time. That changes the write timestamp and if a
refresh runs concurrently with the callback then the refresh may see the
infinite timestamp, the replace updates it, and the refresh drops the
entry as a conflict.

Instead we can detect this case by seeing if the timestamp delta exceeds
our maximum value (120yrs). IF so, then we know this race occurred and
can trust the update. Of course intermediate writes might still have
occurred, so we have to check that our refresh future was sucessfully
unregistered, which would have been discarded in had any other write
occurred.

7086 of 7212 relevant lines covered (98.25%)

0.98 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #3086.1 25 May 2022 05:03AM UTC 0
98.25
Source Files on build #3086
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #3086
  • 94433149 on github
  • Prev Build on v3.dev
  • 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