camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Updated] (CAMEL-8153) Fix potential connection leak in StreamList mode
Date Wed, 17 Dec 2014 07:02:13 GMT


Claus Ibsen updated CAMEL-8153:
    Fix Version/s: 2.15.0

> Fix potential connection leak in StreamList mode
> ------------------------------------------------
>                 Key: CAMEL-8153
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jdbc
>    Affects Versions: 2.14.0
>         Environment: Linux, Apache Tomcat 7.0.41
>            Reporter: Konstantin V. Salikhov
>            Priority: Minor
>             Fix For: 2.14.2, 2.15.0
>         Attachments: leakPatch.diff
> When using camel-jdbc component with newly introduced StreamList mode I've faced a 100%
reproducible connection leak issue.
> My investigation leads me to Tomcat connection pool implementation - it has problem with
returing current connection from Statement object - instead of returning pool specific proxy
it returns actual JDBC connection.
> There is `statement.getConnection()` line in `org.apache.camel.component.jdbc.ResultSetIterator`
so in my particular scenario things work like this:
> 1) Camel borrows connection from Tomcat pool
> 2) Camel leaves JDBC connection and ResultSet intact as we use StreamList mode of camel-jdbc
> 3) Route processes resultset in streaming mode and completes successfully
> 4) Camel tries to close connection, but due to connection pool implementation issue it
closes actual JDBC connection instead of returing it to the pool
> 5) Actual JDBC connection is closed an connection pool is unaware of this fact thinking
it's still open and in use by application
> It would be more error prone to pass proper connection object to ResultSetIterator along
with result set and not rely on statement.getConnection() call.

This message was sent by Atlassian JIRA

View raw message