RE: dbcp pool evictor deadlock?

2009-06-22 Thread Caldarale, Charles R
> From: ma...@apache.org 
> Subject: RE: dbcp pool evictor deadlock?

> Like a number of classes, PoolableConnection extends 
> AbandonedTrace so this isn't entirely unexpected.

I really shouldn't be looking at code with a splitting headache...

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: dbcp pool evictor deadlock?

2009-06-22 Thread Mark Thomas
Eric B. wrote:
>> "Caldarale, Charles R"  wrote in message 
>> news:0aae5ab84b013e45a7b61cb66943c172294795f...@usea-exch7.na.uis.unisys.com...
>>> From: news [mailto:n...@ger.gmane.org] On Behalf Of Eric B.
>>> Subject: dbcp pool evictor deadlock?
>>>
>>> THREAD 1:
>>> Name: Timer-1
>>> State: BLOCKED on
>>> org.apache.tomcat.dbcp.dbcp.poolableconnect...@1e667871
>>> owned by: scheduling.QuartzInternal_Worker-0
>>> Total blocked: 1  Total waited: 15,342
>>>
>>> Stack trace:
>>> org.apache.tomcat.dbcp.dbcp.AbandonedTrace.addTrace(AbandonedTrace.java:175)
>> Assuming this version of Tomcat is using commons-dbcp 1.2.2, there's 
>> something seriously wrong here.  The synchronized block at the above line 
>> is for an AbandonedTrace object, not a PoolableConnection.

Like a number of classes, PoolableConnection extends AbandonedTrace so
this isn't entirely unexpected.

Pool 1.5 fixed a bunch of sync issues. This looks like a variation of
POOL-125 / DBCP-44. Whilst not identical, the various changes in pool
1.5 should (hopefully) resolve this.

> Am running CentOS 5.2 on a 64bit server, running 64bit Sun Java 6.0.11 with 
> Tomcat 6.0.18.  I'm not sure what version of dbcp Tomcat 6.0.18 uses, 
> however.

dbcp 1.2.2 / pool 1.4

> With respect to Mark's posting to switch to apache dpcp 1.2.2 and pool 
> 1.5.1, is there any configuration documentation anywhere that I can read up 
> to find out how to reconfigure tomcat/my app to use those instead of the 
> default ones shipped with Tomcat?  I figure I can d/l them and drop them in 
> the tomcat/lib directory,

Correct.

> but not sure how to indicate to Tomcat to use 
> those classes in the Resource tag.

Add a factory attribute to the resource tag of
org.apache.commons.dbcp.BasicDataSourceFactory

That should do it.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: dbcp pool evictor deadlock?

2009-06-22 Thread Eric B.
>
> "Caldarale, Charles R"  wrote in message 
> news:0aae5ab84b013e45a7b61cb66943c172294795f...@usea-exch7.na.uis.unisys.com...
> > From: news [mailto:n...@ger.gmane.org] On Behalf Of Eric B.
> > Subject: dbcp pool evictor deadlock?
> >
> > THREAD 1:
> > Name: Timer-1
> > State: BLOCKED on
> > org.apache.tomcat.dbcp.dbcp.poolableconnect...@1e667871
> > owned by: scheduling.QuartzInternal_Worker-0
> > Total blocked: 1  Total waited: 15,342
> >
> > Stack trace:
> > org.apache.tomcat.dbcp.dbcp.AbandonedTrace.addTrace(AbandonedTrace.java:175)
>
> Assuming this version of Tomcat is using commons-dbcp 1.2.2, there's 
> something seriously wrong here.  The synchronized block at the above line 
> is for an AbandonedTrace object, not a PoolableConnection.
>
> This is beginning to look like a broken JVM or broken hardware.  Want to 
> tell us what you're using for those (and the OS, while you're at it)?


Am running CentOS 5.2 on a 64bit server, running 64bit Sun Java 6.0.11 with 
Tomcat 6.0.18.  I'm not sure what version of dbcp Tomcat 6.0.18 uses, 
however.

With respect to Mark's posting to switch to apache dpcp 1.2.2 and pool 
1.5.1, is there any configuration documentation anywhere that I can read up 
to find out how to reconfigure tomcat/my app to use those instead of the 
default ones shipped with Tomcat?  I figure I can d/l them and drop them in 
the tomcat/lib directory, but not sure how to indicate to Tomcat to use 
those classes in the Resource tag.

Thanks!

Eric




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: dbcp pool evictor deadlock?

2009-06-22 Thread Eric B.
> > I ran into the most troublesome deadlock over the weekend
> > on my server
>
> Always start by telling us what version of Tomcat (and therefore which 
> commons-dbcp) you're using.  It's likely commons-dbcp 1.2.2 since that's 
> been out for a while, but the exact version may be critical.


Sorry for the oversight.  I'm running Tomcat 6.0.18.

Thanks,

Eric




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: dbcp pool evictor deadlock?

2009-06-22 Thread Caldarale, Charles R
> From: news [mailto:n...@ger.gmane.org] On Behalf Of Eric B.
> Subject: dbcp pool evictor deadlock?
> 
> THREAD 1:
> Name: Timer-1
> State: BLOCKED on
> org.apache.tomcat.dbcp.dbcp.poolableconnect...@1e667871
> owned by: scheduling.QuartzInternal_Worker-0
> Total blocked: 1  Total waited: 15,342
> 
> Stack trace:
> org.apache.tomcat.dbcp.dbcp.AbandonedTrace.addTrace(AbandonedTrace.java:175)

Assuming this version of Tomcat is using commons-dbcp 1.2.2, there's something 
seriously wrong here.  The synchronized block at the above line is for an 
AbandonedTrace object, not a PoolableConnection.

This is beginning to look like a broken JVM or broken hardware.  Want to tell 
us what you're using for those (and the OS, while you're at it)?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: dbcp pool evictor deadlock?

2009-06-22 Thread Mark Thomas
Caldarale, Charles R wrote:
>> From: news [mailto:n...@ger.gmane.org] On Behalf Of Eric B.
>> Subject: dbcp pool evictor deadlock?
>>
>> I ran into the most troublesome deadlock over the weekend 
>> on my server
> 
> Always start by telling us what version of Tomcat (and therefore which 
> commons-dbcp) you're using.  It's likely commons-dbcp 1.2.2 since that's been 
> out for a while, but the exact version may be critical.

It may well be an issue with DBCP. Your best bet would be to switch your
app to use dbcp 1.2.2 and pool 1.5.1 directly rather than the built-in
version bundled with Tomcat.

There are some fixes needed in dbcp 1.2.2 but most of the sync issues
were in pool 1.4/

Plans are afoot to update Tomcat to these versions.

Mark

> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
> MATERIAL and is thus for use only by the intended recipient. If you received 
> this in error, please contact the sender and delete the e-mail and its 
> attachments from all computers.
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: dbcp pool evictor deadlock?

2009-06-22 Thread Caldarale, Charles R
> From: news [mailto:n...@ger.gmane.org] On Behalf Of Eric B.
> Subject: dbcp pool evictor deadlock?
> 
> I ran into the most troublesome deadlock over the weekend 
> on my server

Always start by telling us what version of Tomcat (and therefore which 
commons-dbcp) you're using.  It's likely commons-dbcp 1.2.2 since that's been 
out for a while, but the exact version may be critical.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



dbcp pool evictor deadlock?

2009-06-22 Thread Eric B.
Hi,

I appologize in advance for the cross-post, but I'm really not sure if this 
is a problem with the dbcp code or my configuration.

I ran into the most troublesome deadlock over the weekend on my server, and 
cannot figure out how/or why this deadlock occured.  Via jconsole, I was 
able to get thread information of the deadlock, but that hasn't helped me 
diagnose the problem any further and/or determine if it is a config error, 
or something more critical in the tomcat pool.

>From what I can tell, there is a race condition where the evictor was 
triggered at the exact same moment as a resource was being added back into 
the pool.  The evictor was waiting for the resource to be added to the pool, 
and the resource was waiting for the evictor to finish.  However, I'm not 
sure if I am correct or not.


My jndi settings are as follows:
  
   


My thread trace is the following:
THREAD 1:
Name: Timer-1
State: BLOCKED on org.apache.tomcat.dbcp.dbcp.poolableconnect...@1e667871 
owned by: scheduling.QuartzInternal_Worker-0
Total blocked: 1  Total waited: 15,342

Stack trace:
org.apache.tomcat.dbcp.dbcp.AbandonedTrace.addTrace(AbandonedTrace.java:175)
org.apache.tomcat.dbcp.dbcp.AbandonedTrace.init(AbandonedTrace.java:92)
org.apache.tomcat.dbcp.dbcp.AbandonedTrace.(AbandonedTrace.java:82)
org.apache.tomcat.dbcp.dbcp.DelegatingStatement.(DelegatingStatement.java:61)
org.apache.tomcat.dbcp.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:224)
org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:331)
org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.validateObject(PoolableConnectionFactory.java:312)
org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.evict(GenericObjectPool.java:1217)
   - locked org.apache.tomcat.dbcp.pool.impl.genericobjectp...@741a266
org.apache.tomcat.dbcp.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1341)
java.util.TimerThread.mainLoop(Unknown Source)
java.util.TimerThread.run(Unknown Source)


THREAD 2:
Name: scheduling.QuartzInternal_Worker-0
State: BLOCKED on org.apache.tomcat.dbcp.pool.impl.genericobjectp...@741a266 
owned by: Timer-1
Total blocked: 156,031  Total waited: 206,465

Stack trace:
org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.addObjectToPool(GenericObjectPool.java:1137)
org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.returnObject(GenericObjectPool.java:1076)
org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:87)
   - locked org.apache.tomcat.dbcp.dbcp.poolableconnect...@1e667871
org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:181)
org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.closeConnection(LocalDataSourceConnectionProvider.java:96)
org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:451)
org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:385)
org.hibernate.jdbc.ConnectionManager.close(ConnectionManager.java:324)
org.hibernate.impl.SessionImpl.close(SessionImpl.java:298)
org.springframework.orm.hibernate3.SessionFactoryUtils.closeSession(SessionFactoryUtils.java:791)
org.springframework.orm.hibernate3.SessionFactoryUtils.closeSessionOrRegisterDeferredClose(SessionFactoryUtils.java:777)
org.springframework.orm.hibernate3.HibernateTransactionManager.doCleanupAfterCompletion(HibernateTransactionManager.java:733)
org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:989)
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:782)
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy8.execute(Unknown Source)
sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
org.quartz.core.JobRunShell.run(JobRunShell.java:203)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)



Any help or insight into the problem and/or the correct dbcp settin