[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
getAllWithLoader does not propagate exceptions  XML
Forum Index -> Ehcache
Author Message
const73

neo

Joined: 05/22/2014 08:29:27
Messages: 4
Offline

This happens in version 2.8.2 (the last one I found in Maven repository).

The problem is in the file Cache.java (in the package net.sf.ehcache) in the method asynchronousLoadAll at line 3370.

It catches a Throwable and only logs it. It should in fact rethrow the exception to let the application receive it.

Because of this the method getAllWithLoader does not get an ExecutionException when it calls Future.get.

const73

neo

Joined: 05/22/2014 08:29:27
Messages: 4
Offline

Let me know if I can contribute the fix for this that should be very simple.
Not sure if this was not done intentionally, in which case I would expect a comment in the code to tell why. In this case we could create one extra method just to do not break things that already depend on this bug.
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team