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

ASF subversion and git services commented on GEODE-6759:
--------------------------------------------------------

Commit 51dd01cf309f1fccea9fe41e08fab42ed9759e52 in geode's branch 
refs/heads/develop from Juan José Ramos
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=51dd01c ]

GEODE-6759: Prevent Deleting Pool Still in Use and Fix NPE in Function 
Execution (#3569)

* GEODE-6759: Avoid Deleting Pools Still in Use

- Fixed minor warnings.
- Added unit and integration tests.
- Replaced the usage of `junit.Assert` by `assertj`.
- PoolManagerImpl now checks whether the pool is being used or not
  before unregistering it.
- InternalFunctionExecutionServiceImpl now throws a meaningful
  exception if the pool can not be found instead of NPE.

> Prevent pool destruction if it's still in use and fix NPE in function 
> execution
> -------------------------------------------------------------------------------
>
>                 Key: GEODE-6759
>                 URL: https://issues.apache.org/jira/browse/GEODE-6759
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>            Reporter: Juan José Ramos Cassella
>            Assignee: Juan José Ramos Cassella
>            Priority: Major
>              Labels: GeodeCommons
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> 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:
> {code:java}
> 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();
> {code}
> 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:
> # Don't allow the user to unregister the pool when at least one region is 
> associated to it.
> # Throw a meaningful exception if the pool can't be found before executing 
> the function.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to