geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Smith (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-1762) FunctionService throws exceptions from different places for clients and peers
Date Wed, 17 Aug 2016 21:39:20 GMT

    [ https://issues.apache.org/jira/browse/GEODE-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15425434#comment-15425434
] 

Dan Smith commented on GEODE-1762:
----------------------------------

The above commit added some tests that indicate the issue. Look for GEODE-1762 in FunctionServiceBase
and uncomment the checks. For example the below code shows the peers throw an IllegalStateException
wrapped in a FunctionException, but clients throw a ServerOperationException.

{code}
  @Test()
  public void defaultCollectorThrowsExceptionAfterFunctionThrowsIllegalState() {
    //GEODE-1762 - clients throw from execute, but peers throw from rc.getResult
    thrown.expect(FunctionException.class);
    //GEODE-1762 - clients wrap cause in a ServerOperationException
//    thrown.expectCause(isA(IllegalStateException.class));
    ResultCollector rc = getExecution().execute((context) -> {throw new IllegalStateException();});
    final Object result = rc.getResult();
  }
{code}

> 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
>            Assignee: Dan Smith
>
> 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
(v6.3.4#6332)

Mime
View raw message