-
Bug
-
Resolution: Fixed
-
High
-
6.2.4, 6.3.4
-
6.02
-
Summary
A bug in JIRA, exposed by a certain version of the JIRA Toolkit plugin, will cause JIRA to leak database connections from the Database Connection Pool (DBCP) whilst indexing. This will result in an exhaustion of available connections in the DBCP and JIRA will not function as expected. It's the same behaviour as described in our JIRA Stops Functioning due to Timeout waiting for idle object KB article.
Steps to Reproduce
- Install JIRA toolkit 0.35.10 or higher.
- Create a "Last public comment date" custom field.
- Go to issue search and include this field as a column on the search.
- Run a search returning 50 or so issues (more than configured max connections in dbconfig.xml).
Expected Results
JIRA indexes as per normal without any failures.
Actual Results
The number of active connections in DBCP spikes and they are not released back into the connection pool. As a result of this the following exceptions will be thrown, affecting JIRA's functionality:
java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(ConnectionTracker.java:59) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.trackConnection(DBCPConnectionFactory.java:242) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:73) at org.ofbiz.core.entity.ConnectionFactory.tryGenericConnectionSources(ConnectionFactory.java:69) at org.ofbiz.core.entity.transaction.JNDIFactory.getConnection(JNDIFactory.java:146) at org.ofbiz.core.entity.TransactionFactory.getConnection(TransactionFactory.java:101) at org.ofbiz.core.entity.ConnectionFactory.getConnection(ConnectionFactory.java:59) at org.ofbiz.core.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:367) at org.ofbiz.core.entity.GenericDAO.select(GenericDAO.java:584) at org.ofbiz.core.entity.GenericHelperDAO.findByPrimaryKey(GenericHelperDAO.java:97) at org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:609) at org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:647) ... Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory$1.call(DBCPConnectionFactory.java:246) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory$1.call(DBCPConnectionFactory.java:243) at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(ConnectionTracker.java:53) ... 236 more Caused by: java.util.NoSuchElementException: Timeout waiting for idle object at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1134) at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:79) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) ... 240 more
Workaround
Downgrade JIRA Toolkit plugin to version 0.35.9 (compatible with JIRA Server 6.2 - 6.3.15) or disable the plugin.
To disable:
- Browse to the Add-on Manager.
- Search for the JIRA Toolkit plugin and click on the disable button.
- Reindex JIRA.
To downgrade:
- Browse to the Add-on Manager.
- Uninstall the current version.
- Download 0.35.9 from the Atlassian Marketplace.
- Manually upload the JAR as per Installing add-ons.
- Reindex JIRA.