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

ben-manes / caffeine / #2864 / 1
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: v3.dev
DEFAULT BRANCH: master
Ran 21 Mar 2022 08:22PM UTC
Files 74
Run time 17s
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

21 Mar 2022 06:19PM UTC coverage: 94.87% (+0.07%) from 94.799%
#2864.1

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.

6676 of 7037 relevant lines covered (94.87%)

0.95 hits per line

Source Files on job #2864.1
  • Tree
  • List 0
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2864
  • a6ea5540 on github
  • Prev Job for on v3.dev (##2863.1)
  • Next Job for on v3.dev (##2865.1)
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