ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ozerov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-1097) IgniteFuture.chain() unwraps exceptions incorrectly.
Date Mon, 06 Jul 2015 15:02:04 GMT
Vladimir Ozerov created IGNITE-1097:
---------------------------------------

             Summary: IgniteFuture.chain() unwraps exceptions incorrectly.
                 Key: IGNITE-1097
                 URL: https://issues.apache.org/jira/browse/IGNITE-1097
             Project: Ignite
          Issue Type: Bug
          Components: general
    Affects Versions: 1.1.4
            Reporter: Vladimir Ozerov
            Priority: Critical
             Fix For: sprint-7


Steps to reproduce:
1) Open class GridCacheAbstractFullApiSelfTest
2) Add the field: 
{code}
public static final CacheEntryProcessor<String, Integer, String> ERR_PROCESSOR =
        new CacheEntryProcessor<String, Integer, String>() {
            @Override public String process(MutableEntry<String, Integer> e, Object...
args) {
                throw new RuntimeException("Failed!");
            }
        };
{code}

3) Add the following test and observe that correct EntryProcessorException is thrown:
{code}
public void testTransformException() throws Exception {
    IgniteCache<String, Integer> cache = jcache().withAsync();
    cache.invoke("key2", ERR_PROCESSOR);
    cache.future().get();
}
{code}

4) Modify the test as follows and observe that now incorrect RuntimeException is thrown and
EntryProcessorException is lost:
{code}
public void testTransformException() throws Exception {
    IgniteCache<String, Integer> cache = jcache().withAsync();
    cache.invoke("key2", ERR_PROCESSOR);
    IgniteFuture fut = cache.future().chain(new IgniteClosure<IgniteFuture, Object>()
{
        @Override public Object apply(IgniteFuture o) {
            return o.get();
        }
    });

    fut.get();
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message