[
https://issues.apache.org/jira/browse/POOL-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16694308#comment-16694308
]
ASF GitHub Bot commented on POOL-359:
-------------------------------------
Github user grimreaper commented on the issue:
https://github.com/apache/commons-pool/pull/17
The new test doesn't fail for me if I reverse the original change:
```
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.commons.pool2.impl.TestGenericObjectPool
[INFO] Tests run: 84, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
106.528 s - in org.apache.commons.pool2.impl.TestGenericObjectPool
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 84, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 01:57 min
[INFO] Finished at: 2018-11-20T22:58:11-08:00
[INFO]
------------------------------------------------------------------------
mvn test -Dtest=TestGenericObjectPool 34.10s user 7.66s system 34% cpu
1:59.76 total; max RSS 305800Ki
[45682 22:58:11.583 eax@FlyingEagle ...ache/commons/commons-pool]∴git diff
(git:commons-pool)-[master●]
diff --git i/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
w/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
index b92b87a9..2fc9ffd8 100644
--- i/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
+++ w/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
@@ -94,7 +94,7 @@ static synchronized void schedule(
static synchronized void cancel(
final BaseGenericObjectPool<?>.Evictor task, final long
timeout, final TimeUnit unit) {
task.cancel();
- if (executor != null && executor.getQueue().size() == 0) {
+ if (executor.getQueue().size() == 0) {
executor.shutdown();
try {
executor.awaitTermination(timeout, unit);
```
> NullPointerException closing multiple GenericObjectPools
> --------------------------------------------------------
>
> Key: POOL-359
> URL: https://issues.apache.org/jira/browse/POOL-359
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 2.6.0
> Reporter: Michael Wintermeyer
> Priority: Major
>
> {code:java}
> java.lang.NullPointerException
> at org.apache.commons.pool2.impl.EvictionTimer.cancel(EvictionTimer.java:97)
> at
> org.apache.commons.pool2.impl.BaseGenericObjectPool.startEvictor(BaseGenericObjectPool.java:753)
> at
> org.apache.commons.pool2.impl.GenericObjectPool.close(GenericObjectPool.java:694)
> {code}
> Possible when multiple pools in the same process each call #close.
> GenericObjectPool#close checks #isClosed before proceeding, but that call
> checks a non-static instance variable. It calls into EvictionTimer#cancel
> which sets the _static_ variable EvictionCache.executor to null.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)