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

ben-manes / caffeine / #3362
100%

Build:
DEFAULT BRANCH: master
Ran 21 Oct 2022 06:30AM UTC
Jobs 1
Files 77
Run time 3s
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
#3362

push

github-actions

ben-manes
adjust when explicit puts discard a refresh

Reviewing this code, I don't recall exactly why it was safe to discard the
refresh prior to the synchronized block. Likely it was because those other
conditions covered insert and putIfAbsent overwriting an expired entry,
whereas a live update will necessarily overwrite the value. Yet if a
putIfAbsent is overwriting an expired entry, that implies that it beat an
eviction which did not discard that in-flight future. As synchronization
might be delayed, it would still seem like an ABA style problem could
occur in a worst case scenario.

In all other updates the refresh is discarded within the synchronized
block. The refresh callback validate itself under this lock by removing
its future and, if successful, checking the results are consistent. It
seems safer to maintain this pattern on put, even if an unlikely or
perhaps impossible race, if only for consistency and avoid having to
rethink it all anew every few years when reviewing the code.

7398 of 7508 relevant lines covered (98.53%)

0.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #3362.1 21 Oct 2022 06:30AM UTC 0
98.53
Source Files on build #3362
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #3362
  • 1836b0f7 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