[ https://issues.apache.org/jira/browse/GEODE-7746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17039362#comment-17039362 ]
ASF subversion and git services commented on GEODE-7746: -------------------------------------------------------- Commit 54890b3e28bb992a0c1a6069b62de065034d2df4 in geode's branch refs/heads/develop from Jianxia Chen [ https://gitbox.apache.org/repos/asf?p=geode.git;h=54890b3 ] GEODE-7746: onServers function throws a NPE if the distributed system is shutdown (#4690) * GEODE-7746: Fix the NullPointerException on Function Execution The NullPointerException of GEODE-7746 can be reproduced by ClientServerSessionCacheDUnitTest.startingAClientWithoutServersFails() Add null check and throw NoAvailableServersException > 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)