Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.11.1
-
None
Description
There is a potential for an NPE happening in the finally block of borrowObject:
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.commons.pool2.impl.GenericKeyedObjectPool$ObjectDeque.getNumInterested()" because "objectDeque" is null at org.apache.commons.pool2.impl.GenericKeyedObjectPool.deregister(GenericKeyedObjectPool.java:821) at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:507) at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:350)
From reading the code, it seems this could happen e.g. if a pool is concurrently cleared while a borrow is in progress.
Not sure what a proper solution here would be. Maybe deregister should silently do nothing if poolMap.get(k) returns null?
Attachments
Issue Links
- links to