geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Smith (JIRA)" <>
Subject [jira] [Commented] (GEODE-625) A function's ResultCollector throws ClassCastException when ResultSender.sendException is invoked
Date Fri, 29 Apr 2016 21:05:12 GMT


Dan Smith commented on GEODE-625:

A little be more context on this:

It looks like the current behavior if you call ResultSender.sendResult with an exception then
the exception is never actually propagated to the user's ResultCollector. Instead, it's hidden
from the user's ResultCollector but thrown from the getResult method of the ResultCollector
returned by Execution.execute(). That's the same behavior you get if you simply throw an exception
from the body of the function.

On the other hand, if you call sendException, then the exception *is* passed to the addResult
method of the users ResultCollector, and does not throw an exception.

This seems somewhat backwards. It seems *anything* passed to sendResult and lastResult ought
to be passed on to the addResult method of the ResultCollector. sendException should perhaps
trigger the exception behavior we are seeing from the default result collector, or be passed
to something like an addException method on a user's result collector.

Unfortunately, it will be hard to get to the desired behavior in a backwards compatible way.

> A function's ResultCollector throws ClassCastException when ResultSender.sendException
is invoked
> -------------------------------------------------------------------------------------------------
>                 Key: GEODE-625
>                 URL:
>             Project: Geode
>          Issue Type: Bug
>          Components: functions
>            Reporter: Ashvin
>            Assignee: Dan Smith
> For e.g. If LuceneFunction.execute invokes resultSender.sendException, the following
error is generated.
> {code}
> java.lang.ClassCastException: java.lang.IllegalArgumentException cannot be cast to
> ernal.distributed.TopEntriesCollector
> 	at com.gemstone.gemfire.cache.lucene.internal.distributed.TopEntriesFunctionCollector.addResult(TopEntriesFunctionColle
> 	at com.gemstone.gemfire.internal.cache.execute.LocalResultCollectorImpl.addResult(
> 	at com.gemstone.gemfire.internal.cache.execute.PartitionedRegionFunctionResultSender.lastResult(PartitionedRegionFuncti
> 	at com.gemstone.gemfire.internal.cache.execute.PartitionedRegionFunctionResultSender.lastResult(PartitionedRegionFuncti
> 	at com.gemstone.gemfire.internal.cache.execute.PartitionedRegionFunctionResultSender.sendException(PartitionedRegionFun
> 	at com.gemstone.gemfire.cache.lucene.internal.distributed.LuceneFunction.execute(
> {code}

This message was sent by Atlassian JIRA

View raw message