Skip to content

LoadingCache doesn't get along well with interrupted threads #1122

Open
@gissuebot

Description

@gissuebot

Original issue created by dterrell on 2012-08-28 at 06:20 PM


two separate problems here:

  1. When a thread is interrupted while blocking on another thread's cache load, it swallows the interrupt and continues to block. This makes no sense and is not best practice; Future.get() throws InterruptedException for a reason.

  2. When a CacheLoader is interrupted and throws InterruptedException and/or leaves the interrupted status set while throwing another exception (we tend to turn it into our own Runtime InterruptedException), that exception is propagated to any other thread blocking on the cache load instead of letting one of them attempt to load.

I think these are both mistakes.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions