You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "jerrybi (JIRA)" <ji...@apache.org> on 2012/09/24 13:42:08 UTC
[jira] [Created] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
jerrybi created POOL-230:
----------------------------
Summary: waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
Key: POOL-230
URL: https://issues.apache.org/jira/browse/POOL-230
Project: Commons Pool
Issue Type: Bug
Affects Versions: 1.5.4
Environment: tomcat using dbcp
Reporter: jerrybi
"Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
- locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
it seems that the problem bellow still exits.
https://issues.apache.org/jira/browse/POOL-149
I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462350#comment-13462350 ]
Phil Steitz commented on POOL-230:
----------------------------------
Are the 2. or 3. type threads holding connections? Are you sure you close connections on exception paths? Try enabling abandoned connection cleanup and logging and see if that uncovers anything. Also, try upgrading to the latest [pool] version. The symptoms in the [pool]-related threads above look consistent with pool depletion, which can happen if hung threads are holding connections or exceptions are being abandoned on exception paths.
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462422#comment-13462422 ]
Phil Steitz commented on POOL-230:
----------------------------------
What does pool.getConn() look like int the wrapper? Also close.
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461758#comment-13461758 ]
Gary D. Gregory commented on POOL-230:
--------------------------------------
Can you try 1.5.7 or 1.6?
Gary
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462305#comment-13462305 ]
Phil Steitz commented on POOL-230:
----------------------------------
Can you attach a full thread dump? Are you sure your code is closing all connections?
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "jerrybi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462294#comment-13462294 ]
jerrybi commented on POOL-230:
------------------------------
I may not describe the problem clearly.
I am using DBCP's BasicDataSource.
InitialSize = 10
MaxActive=50
MaxIdle=20
MinIdle=10
MaxWait = 6000000
When the problem heppens.
I could still login mysql using mysql client.
"show processlist" cmd list only less then 20 connections.
but the work threads in my program block in dataSource.getConnection()
Even after stop send client requests for a long time, they still blocks
I don't think the pool has been exhausted.
You may read the following page:
http://stackoverflow.com/questions/5714511/deadlock-issue-in-dbcp-deployed-on-tomcat
I have the same proplem with Iravanchi who didn't get the answer either.
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470582#comment-13470582 ]
Phil Steitz commented on POOL-230:
----------------------------------
Absent any evidence that there is an actual pool bug here, I am leaning toward closing as not an issue. Looks more like an issue for the pool or dbcp user list. Going once, going twice...
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462428#comment-13462428 ]
Phil Steitz commented on POOL-230:
----------------------------------
Also, if any threads are interrupted, or if the datasource is closed and reopened, you could be being impacted by bugs fixed in 1.5.6 or 1.5.7. See the release notes here:
http://commons.apache.org/pool/changes-report.html#a1.5.7
Are you using the idle object evictor? Are all settings not included above in BasicDataSource defaulted?
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "jerrybi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462344#comment-13462344 ]
jerrybi commented on POOL-230:
------------------------------
I am sure everytime after I use the connection, I close it (release it to the pool)
the blocked threads or related Exceptions:
1.
"http-8093-96" daemon prio=10 tid=0x000000004106c800 nid=0x64f4 in Object.wait() [0x00007f57fc4c2000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000e7389990> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
- locked <0x00000000e7389990> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.netease.backend.db.cloudadmin.sysdb.dao.impl.DBPoolDbcpImpl.getConn(DBPoolDbcpImpl.java:46)
at com.netease.backend.db.cloudadmin.sysdb.dao.ConnectionManager.startTransaction(ConnectionManager.java:29)
at com.netease.backend.db.cloudadmin.sysdb.dao.impl.DBAccessImpl.getProductDdbList(DBAccessImpl.java:872)
at com.netease.backend.db.cloudadmin.logicaltier.handler.impl.SysStatusHandlerImpl.getProductDdbList(SysStatusHandlerImpl.java:194)
at com.netease.backend.db.cloudadmin.logicaltier.handler.impl.CmdHandlerImpl.getProductDdbList(CmdHandlerImpl.java:168)
at com.netease.backend.db.cloudadmin.logicaltier.handler.impl.CmdHandler.proc(CmdHandler.java:183)
at com.netease.backend.db.cloudadmin.front.control.RequestAndResponseHandler.getResponseWrapper(RequestAndResponseHandler.java:99)
at com.netease.backend.db.cloudadmin.front.control.RequestAndResponseHandler.handleResult(RequestAndResponseHandler.java:52)
at com.netease.backend.db.cloudadmin.front.control.WebAdminController.doGet(WebAdminController.java:35)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
2.
"QueueCapacityLimitedThreadPool-1-thread-9" daemon prio=10 tid=0x00000000411f7000 nid=0x6086 waiting on condition [0x00007f580ca79000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000e63391e8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
at java.util.concurrent.ArrayBlockingQueue.take(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
3.
"CachedDaemonThreadPool-1-thread-18" daemon prio=10 tid=0x0000000041097000 nid=0x6052 waiting on condition [0x00007f580cb7a000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000e63064b8> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
at java.util.concurrent.SynchronousQueue.take(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
4.
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 com.netease.backend.db.cloudadmin.sysdb.dao.impl.DBPoolDbcpImpl.getConn(DBPoolDbcpImpl.java:46)
at com.netease.backend.db.cloudadmin.sysdb.dao.ConnectionManager.getConnection(ConnectionManager.java:90)
at com.netease.backend.db.cloudadmin.sysdb.dao.impl.DBAccessImpl.getBackupCount(DBAccessImpl.java:1975)
at com.netease.backend.db.cloudadmin.logicaltier.handler.impl.ResultCountHandlerImpl.getProductBackupCount(ResultCountHandlerImpl.java:103)
at com.netease.backend.db.cloudadmin.logicaltier.handler.impl.CmdHandlerImpl.getProductBackupCount(CmdHandlerImpl.java:296)
at com.netease.backend.db.cloudadmin.logicaltier.handler.impl.CmdHandler.proc(CmdHandler.java:241)
at com.netease.backend.db.cloudadmin.front.control.RequestAndResponseHandler.getResponseWrapper(RequestAndResponseHandler.java:99)
at com.netease.backend.db.cloudadmin.front.control.RequestAndResponseHandler.handleResult(RequestAndResponseHandler.java:52)
at com.netease.backend.db.cloudadmin.front.control.WebAdminController.doGet(WebAdminController.java:35)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
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.PoolingDataSource.getConnection(PoolingDataSource.java:106)
... 24 more
QueueCapacityLimitedThreadPool-1-thread-9, CachedDaemonThreadPool-1-thread-18 wait on Database Operation
when Database Operation returns (either success or exception ) they will be notified.
getConnection() blocks so the threads wait forever
after getConnection() timesout, throws Exception 4
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "jerrybi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462356#comment-13462356 ]
jerrybi commented on POOL-230:
------------------------------
2. ( or 3.) does not hold the connections. it just wait the database operation to complete.
it is how I use connections
DBPool is a wrapper of BasicDataSource, you can just think it is BasicDataSource
public class ConnectionManager {
private static final Logger logger = Logger.getLogger(ConnectionManager.class);
private static ThreadLocal<Connection> connThreadLocal = new ThreadLocal<Connection>();
private static DBPool pool;
public static void init(DBPool pool) {
ConnectionManager.pool = pool;
}
public static void startTransaction() throws SQLException {
if (pool == null) {
throw new RuntimeException("FATAL:ConnectionManager is not inited!");
}
Connection conn = connThreadLocal.get();
if (conn != null) {
throw new RuntimeException("FATEL:Transaction Hang");
}
conn = pool.getConn();
conn.setAutoCommit(false);
connThreadLocal.set(conn);
}
public static void commit() throws SQLException {
Connection conn = connThreadLocal.get();
if (conn == null) {
logger.warn("commit with null conn!");
return;
}
connThreadLocal.set(null);
try {
try {
if (conn.getAutoCommit()) {
logger.warn("commit with autoCommit!");
}
} catch (SQLException e) {
logger.error("getAutoCommit failed!", e);
}
conn.commit();
} catch (SQLException e) {
logger.error("commit failed!", e);
throw e;
} finally {
try {
conn.setAutoCommit(true);
} catch (Exception e) {
logger.error("setAutoCommit(true) failed!", e);
}
closeConn(conn);
}
}
public static void rollBack() {
Connection conn = connThreadLocal.get();
if (conn == null)
return;
connThreadLocal.set(null);
try {
conn.rollback();
} catch (Exception e) {
// ignore
logger.error("rollback failed!", e);
}
try {
conn.setAutoCommit(true);
} catch (Exception e) {
logger.error("setAutoCommit(true) failed!", e);
}
closeConn(conn);
}
public static Connection getConnection() throws SQLException {
if (pool == null) {
throw new RuntimeException("FATAL:ConnectionManager is not inited!");
}
Connection conn = connThreadLocal.get();
if (conn == null)
conn = pool.getConn();
return conn;
}
public static void releaseConnection(Connection conn) {
if (pool == null) {
throw new RuntimeException("FATAL:ConnectionManager is not inited!");
}
if (connThreadLocal.get() == null) {
closeConn(conn);
}
}
public static void closePreparedStatement(PreparedStatement ps) {
if (ps != null) {
try {
ps.close();
} catch (SQLException e) {
logger.error("close ps error", e);
}
}
}
public static void closeResultSet(ResultSet rs) {
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
logger.error("close rs error", e);
}
}
}
private static void closeConn(Connection conn) {
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
logger.error("close conn error", e);
}
}
}
}
I use Connection like this:
1. use Transaction
funtion() {
try {
ConnectionManager.startTransaction();
Connection = null;
part1();
part2();
ConnectionManager.commit();
}
catch(Exception e) {
ConnectionManager.rollback();
}
}
part1(), part2() like:
try {
conn = ConnectionManager.getConnection();
do something
}finally {
ConnectionManager.closeResultSet(rs);
ConnectionManager.closePreparedStatement(ps);
ConnectionManager.releaseConnection(conn);
}
2. not use Transaction
function() {
Connection = null;
try {
conn = ConnectionManager.getConnection();
do something
}finally {
ConnectionManager.closeResultSet(rs);
ConnectionManager.closePreparedStatement(ps);
ConnectionManager.releaseConnection(conn);
}
}
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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
[jira] [Commented] (POOL-230) waiting on <0x00000000e7440168> (a
org.apache.commons.pool.impl.GenericObjectPool$Latch)
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461912#comment-13461912 ]
Phil Steitz commented on POOL-230:
----------------------------------
Looks like normal behavior to me when the pool is configured to block when exhausted and there are no instances available in the pool. The thread is executing a timed wait, waiting for an instance to become available. This does not look related to POOL-149 to me.
> waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> ----------------------------------------------------------------------------------------
>
> Key: POOL-230
> URL: https://issues.apache.org/jira/browse/POOL-230
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5.4
> Environment: tomcat using dbcp
> Reporter: jerrybi
>
> "Thread-20" daemon prio=10 tid=0x00007f5810214000 nid=0x5f7b in Object.wait() [0x00007f581527c000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
> - locked <0x00000000e7440168> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
> at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
> at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> it seems that the problem bellow still exits.
> https://issues.apache.org/jira/browse/POOL-149
> I am using commons-dbcp-1.3 and commons-pool-1.5.4
--
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