You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@manifoldcf.apache.org by "Karl Wright (JIRA)" <ji...@apache.org> on 2015/06/23 18:50:00 UTC

[jira] [Reopened] (CONNECTORS-1202) JDBC connection handling doesn't always recover if connections can go stale

     [ https://issues.apache.org/jira/browse/CONNECTORS-1202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Wright reopened CONNECTORS-1202:
-------------------------------------

User reports the following problem:

"i tested CONNECTORS-1202 (stale connection check) and i encounter a dead lock in the connection pool when i simulate a database outage. 

I use ManifoldCF 1.7.1 with CONNECOTRS-1202 patch applied an MySQL as Database.

Steps for reproduction :

1. Start ManifoldCF with a limited ConnectionPool Max size of 5
2. When everything is running stop the database
3. Wait for connection exeptions to occur
4. Click around in the ui to start more threads that want to aquire a connection
5. Everything freezes 
6. Start the database
7. Still everything is freezed. no recovery is happening.

As far as i understand the ConnectionPool implementation, the problem is that the activeConnections counter is not decremented when the DriverManager fails to get a Connection. On every failed DriverManager.getConnection call the pool gets more and more 'exhausted'. When activeConnections hits the size limit, threads go to Object.wait(). But notifyAll will never be called because there is no outstanding connection to return."

> JDBC connection handling doesn't always recover if connections can go stale
> ---------------------------------------------------------------------------
>
>                 Key: CONNECTORS-1202
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1202
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Framework core
>    Affects Versions: ManifoldCF 1.9, ManifoldCF 2.1
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>             Fix For: ManifoldCF 1.10, ManifoldCF 2.2
>
>         Attachments: CONNECTORS-1202.patch
>
>
> Our connection pool doesn't deal well with JDBC connection handles that go stale because the database server was shut down.
> This isn't a problem for most databases, but MySQL seems to not have good recovery in their JDBC driver.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)