[
https://issues.apache.org/jira/browse/CONNECTORS-638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573574#comment-13573574
]
Karl Wright commented on CONNECTORS-638:
----------------------------------------
The log is very puzzling.
Only seven active + leaked connections are listed. This is out of a connection
pool that had 100 in it at the start. And yet we seem to be out of connections!
The other interesting point is that all seven of the handles listed are at
exactly the same place in the code - which is doing something pretty basic: a
single query, not in a transaction.
The code in question that manages connections through this pathway is pretty
straightforward:
{code}
// Grab a connection
WrappedConnection tempConnection =
ConnectionFactory.getConnection(jdbcUrl,jdbcDriverClass,databaseName,userName,password);
try
{
// Initialize the connection (for HSQLDB)
initializeConnection(tempConnection.getConnection());
return
executeViaThread(tempConnection.getConnection(),query,params,bResults,maxResults,spec,returnLimit);
}
catch (ManifoldCFException e)
{
if (e.getErrorCode() == ManifoldCFException.INTERRUPTED)
// drop the connection object on the floor, so it cannot possibly be
reused
tempConnection = null;
throw e;
}
finally
{
if (tempConnection != null)
ConnectionFactory.releaseConnection(tempConnection);
}
{code}
The only huge warning sign here is the special treatment of
ManifoldCFException.INTERRUPTED exceptions. These are usually thrown only when
we're trying to shut down ManifoldCF. I wonder if the PostgreSQL JDBC driver
is throwing them somehow under other situations - maybe when a query takes to
long and PostgreSQL aborts it?
If that exception IS getting thrown, it would also cause the worker thread in
which it happened to shut itself down. A thread dump of the agents process
should show definitively if we've lost worker threads due to this reason.
Erlend, can you get that, and attach it also?
> Possible leakage of database connection handles
> -----------------------------------------------
>
> Key: CONNECTORS-638
> URL: https://issues.apache.org/jira/browse/CONNECTORS-638
> Project: ManifoldCF
> Issue Type: Bug
> Components: Framework core
> Affects Versions: ManifoldCF 1.0, ManifoldCF 1.0.1
> Reporter: Karl Wright
> Assignee: Karl Wright
> Priority: Critical
> Fix For: ManifoldCF 1.2
>
> Attachments: manifoldcf.log
>
>
> Reports of a leak of connection handles, shown because ManifoldCF winds up
> waiting to get a connection, and failing.
> The database in question so far always seems to be PostgreSQL, FWIW, and it
> has been proven that there is a connection handle leak, so that all the
> crawler threads are eventually waiting for non-existent connection handles.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira