You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2018/10/23 11:46:00 UTC

[jira] [Commented] (DBCP-513) Hundreads of threads in Wait state with below stack trace

    [ https://issues.apache.org/jira/browse/DBCP-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16660478#comment-16660478 ] 

Mark Struberg commented on DBCP-513:
------------------------------------

We face the same issue in Apache OpenJPA when testing against a real MySQL DB.
We spin up 80 threads which do an EntityManager query and an em.close() after that (should free the connection);

It seems that there are race conditions which do lead to the notEmpty Condition doesn't get fired.

I'll attach 2 test runs. One which has only 1 tread which keeps hanging (dbcp_lock_1.txt), the other with 7 threads still open (dbcp_lock_7.txt. 

Here is my environment:
{noformat}
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /opt/apache/maven
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181.b15-6.fc28.x86_64/jre
Default locale: de_AT, platform encoding: UTF-8
OS name: "linux", version: "4.18.14-200.fc28.x86_64", arch: "amd64", family: "unix"
{noformat}

> Hundreads of threads in Wait state with below stack trace
> ---------------------------------------------------------
>
>                 Key: DBCP-513
>                 URL: https://issues.apache.org/jira/browse/DBCP-513
>             Project: Commons DBCP
>          Issue Type: Bug
>    Affects Versions: 2.1.1
>         Environment: Java Version: 
> 1.8.0_121
>  OS Complete Version: 
> Linux sdpvvrwm556 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Dec 28 14:23:39 EST 2017 x86_64 x86_64 x86_64 GNU/Linux
>  
> DBCP Jar:
> commons-dbcp2-2.1.1.jar
>            Reporter: Mahesh
>            Priority: Blocker
>         Attachments: Screen Shot 2018-08-05 at 10.29.52 AM.png, dbcpthread.zip
>
>
> Hello Team,
> Our application suddenly stops responding, when we checked thread dump, most of the threads are in wait state with below stack trace, we had to restart server to make it active, can you pelase provide your inputs on the root cause & resolution?
>  
> "JSockConn Thread #4532" #40906 prio=5 os_prio=0 tid=0x00007f84382ce800 nid=0xc692 waiting on condition [0x00007f83d38f8000]
>  java.lang.Thread.State: WAITING (parking)
>  at sun.misc.Unsafe.park(Native Method)
>  - parking to wait for <0x00000005c30a11b8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
>  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
>  at org.apache.commons.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:583)
>  at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:442)
>  at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
>  at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134)
>  at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)