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

Prevent pool destruction if it's still in use and fix NPE in function execution

    XMLWordPrintableJSON

Details

    Description

      A NullPointerException can be thrown on client side if the application executes a function on a pool that has been destroyed.
      The following code reproduces the issue:

      ClientCache clientCache = new ClientCacheFactory().create();
      PoolManager.createFactory().addLocator(InetAddress.getLocalHost().getHostName(), locator.getPort()).create("poolOne");
      
      Region region = clientCache.createClientRegionFactory(PROXY).setPoolName("poolOne").create("TestRegion");
      PoolManagerImpl.getPMI().unregister(PoolManager.find("poolOne"));
      
      FunctionService.onRegion(region).execute(testFunction).getResult();
      

      The problem is that we don't verify whether the Pool is currently being used or not within the unregister method. The following should be done:

      1. Don't allow the user to unregister the pool when at least one region is associated to it.
      2. Throw a meaningful exception if the pool can't be found before executing the function.

      Attachments

        Issue Links

          Activity

            People

              jjramos Juan Ramos
              jjramos Juan Ramos
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 3.5h
                  3.5h