Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-7746

An onServers function throws a NullPointerException if the distributed system is shutdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.13.0
    • functions

    Description

      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:

      FunctionService.onServers(this.cache).execute("TestFunction").getResult();
      

      If I stop the distributed system using gfsh like:

      gfsh shutdown --include-locators=true
      

      The client throws a NullPointerException like:

      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)
      

      The NPNullPointerExceptionE is in ExecuteFunctionOp.constructAndGetFunctionTasks here:

      List<ServerLocation> servers = pool.getConnectionSource().getAllServers();
      

      In this case, servers is null.

      Attachments

        Issue Links

          Activity

            People

              jchen21 Jianxia Chen
              boglesby Barrett Oglesby
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h