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

ben-manes / caffeine / #2613
100%

Build:
DEFAULT BRANCH: master
Ran 14 Jul 2021 07:38AM UTC
Jobs 1
Files 73
Run time 5s
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
#2613

push

github-actions

ben-manes
Optimize refreshAfterWrite

When an entry is eligible for refresh, only one thread should block to
schedule it. Previously all readers would block on a map computeIfAbsent
operation to obtain the future. While this allows refreshes to be
linearizable, it adds a small and unnecessary synchronization point. The
change restores the non-blocking behavior of v2.x, while keeping the
improvements of v3's rewrite.

The write timestamp is CAS'd as a soft lock to allow subsequent readers
to skip attempting to refresh. The least significant bit is used as a
flag for locking, causing the timestamp to be off by 1ns from the ideal
value. (Thanks @Maaartinus for suggesting this idea in https://github.com/ben-manes/caffeine/issues/282#issuecomment-440887934)

Also restored from v2 is to suppress and log exceptions if the cache
loader fails when producing the refresh future.

The inspections to obtain an entry's age were improved, such as not
resurrecting an expired entry.

6220 of 6713 relevant lines covered (92.66%)

0.93 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #2613.1 14 Jul 2021 07:38AM UTC 0
92.66
Source Files on build #2613
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #2613
  • b5dbe2d9 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