[
https://issues.apache.org/jira/browse/POOL-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13976251#comment-13976251
]
Phil Steitz edited comment on POOL-264 at 4/22/14 12:57 AM:
------------------------------------------------------------
Thank you for reporting this.
A workaround that you can try is to leave maxActive = -1 but set
WHEN_EXHAUSTED_ACTION to WHEN_EXHAUSTED_BLOCK. That may correct the sync and
will achieve the same end result as negative maxActive means no limit to the
number of available instances per key.
I think the problem here (also present in GOP) may be that the sync in the
switch case block is on the pool's monitor rather than the latch.
was (Author: psteitz):
Thank you for reporting this. It would be great if you could provide a stack
trace showing the NPE.
A workaround that you can try is to leave maxActive = -1 but set
WHEN_EXHAUSTED_ACTION to WHEN_EXHAUSTED_BLOCK. That may correct the sync and
will achieve the same end result as negative maxActive means no limit to the
number of available instances.
> NullPointerException in GKOP.borrowObject()
> -------------------------------------------
>
> Key: POOL-264
> URL: https://issues.apache.org/jira/browse/POOL-264
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.6
> Reporter: Leonid Meyerguz
>
> While I cannot pin down a consistent repro, I occasionally observe a
> NullPointerException at
> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1126)
> The pool is configured as follows:
> maxActive = -1
> maxIdle = 32
> maxTotal = 32
> whenExhaustedAction = WHEN_EXHAUSTED_GROW
> timeBetweenEvictionRunsMillis = 20000
> minEvictableIdleTimeMillis = 60000
> numTestsPerEvictionRun = -1
> The NullPointerException is thrown in the WHEN_EXHAUSTED_GROW branch of the
> code. Specifically it appears that latch.getPool() returns null.
> Any suggestions for a work-around would be appreciated.
--
This message was sent by Atlassian JIRA
(v6.2#6252)