[ https://issues.apache.org/jira/browse/GEODE-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Smith reassigned GEODE-1762: -------------------------------- Assignee: (was: Dan Smith) > FunctionService throws exceptions from different places for clients and peers > ----------------------------------------------------------------------------- > > Key: GEODE-1762 > URL: https://issues.apache.org/jira/browse/GEODE-1762 > Project: Geode > Issue Type: Bug > Components: functions > Reporter: Dan Smith > Priority: Major > > If a function throws an exception, the exception gets passed back to the > caller from a different location if the function is executed from a client or > a peer. > From a peer, the exception is thrown from the result collector > From > [FunctionServiceBase|https://github.com/apache/incubator-geode/blob/aca7b288f378ec05e00ec3a9277265d1a9679b4a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceBase.java]: > {code} > @Test() > public void > defaultCollectorThrowsExceptionAfterFunctionThrowsIllegalState() { > final Host host = Host.getHost(0); > ResultCollector rc = getExecution().execute((context) -> {throw new > IllegalStateException();}); > //On a peer the exception is thrown from the rc.getResult call, below > final Object result = rc.getResult(); > } > {code} > However, from a client executing the exact same code, the exception gets > thrown from the Execution.execute() method instead. > {code} > @Test() > public void > defaultCollectorThrowsExceptionAfterFunctionThrowsIllegalState() { > final Host host = Host.getHost(0); > //On a client the exception is thrown from the execute call, below > ResultCollector rc = getExecution().execute((context) -> {throw new > IllegalStateException();}); > } > {code} > The exception handling should be consistent between clients and peers. -- This message was sent by Atlassian JIRA (v7.6.3#76005)