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

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

Build:
Build:
LAST BUILD BRANCH: v3.dev
DEFAULT BRANCH: master
Ran 21 Mar 2022 09:21AM UTC
Jobs 1
Files 74
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
#2862

push

github-actions

ben-manes
Add tests for thread interruption

When a cache is interrupted by the CacheLoader, it sets the thread flag
and wraps the InterruptedException for a runtime throw. This matches
Guava's behavior so that status is communicated without having the
checked exception in the interface contract. Neither cache apply this
rule when the mapping function is provided since the caller had to
handle the interruption themselves to bubble it up as a runtime
failure.

This applies to an async cache if interrupted while obtaining the
future. If the thread computing the future is interrupted then that
is merely the failure reason, but the consumer is not interrupted.

Interruption can occur silently when performing a refreshAfterWrite's
reload. This too sets the flag, but does not throw an exception as
documented that reload failures are logged and suppressed. The caller
can still check its interruption status, e.g. to halt its processing
in classic threaded logic.

Generally we don't recommend using interruption as a means of
communicating cancelation as a confusing, error prone, and not widely
used mechanism. Likely virtual threads will promote a better approach,
or at least evangulize interruption so that developers understand how
to use it properly.

6648 of 7037 relevant lines covered (94.47%)

0.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #2862.1 21 Mar 2022 09:21AM UTC 0
94.47
Source Files on build #2862
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #2862
  • da4758a0 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