[ 
https://issues.apache.org/jira/browse/GEODE-7746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jianxia Chen resolved GEODE-7746.
---------------------------------
    Resolution: Fixed

> An onServers function throws a NullPointerException if the distributed system 
> is shutdown
> -----------------------------------------------------------------------------------------
>
>                 Key: GEODE-7746
>                 URL: https://issues.apache.org/jira/browse/GEODE-7746
>             Project: Geode
>          Issue Type: Bug
>          Components: functions
>            Reporter: Barrett Oglesby
>            Assignee: Jianxia Chen
>            Priority: Major
>              Labels: GeodeCommons
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> I have a distributed system with a locator and 3 servers. I then start a 
> client executing an onServers function forever.
> The client is doing this in a loop:
> {noformat}
> FunctionService.onServers(this.cache).execute("TestFunction").getResult();
> {noformat}
> If I stop the distributed system using gfsh like:
> {noformat}
> gfsh shutdown --include-locators=true
> {noformat}
> The client throws a NullPointerException like:
> {noformat}
> org.apache.geode.cache.execute.FunctionException: 
> java.lang.NullPointerException
>       at 
> org.apache.geode.internal.cache.execute.ServerFunctionExecutor.executeOnServer(ServerFunctionExecutor.java:234)
>       at 
> org.apache.geode.internal.cache.execute.ServerFunctionExecutor.executeFunction(ServerFunctionExecutor.java:104)
>       at 
> org.apache.geode.internal.cache.execute.ServerFunctionExecutor.execute(ServerFunctionExecutor.java:368)
>       at 
> org.apache.geode.internal.cache.execute.ServerFunctionExecutor.execute(ServerFunctionExecutor.java:377)
>       at TestClient.executeFunction(TestClient.java:23)
>       at TestClient.executeFunctionForever(TestClient.java:34)
>       at TestClient.main(TestClient.java:15)
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.geode.cache.client.internal.ExecuteFunctionOp.constructAndGetFunctionTasks(ExecuteFunctionOp.java:131)
>       at 
> org.apache.geode.cache.client.internal.ExecuteFunctionOp.execute(ExecuteFunctionOp.java:79)
>       at 
> org.apache.geode.internal.cache.execute.ServerFunctionExecutor.executeOnServer(ServerFunctionExecutor.java:217)
> {noformat}
> The NPNullPointerExceptionE is in 
> ExecuteFunctionOp.constructAndGetFunctionTasks here:
> {noformat}
> List<ServerLocation> servers = pool.getConnectionSource().getAllServers();
> {noformat}
> In this case, servers is null.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to