[opencms-dev] OpenCms odd behaviour : infinite loading

Aurélie PREVIT aurelie.previt at wanadoo.fr
Tue Oct 14 11:16:01 CEST 2003


Hello,
I have maybe an answer for OpenCms odd behaviour : I 've had stability problems related to opencms 5.0 at Oracle 8 and Weblogic Server 8.1. The problems consited of opencms errors such as stoppage of Opencms that neither halts nor opens the pages (infinite loading). These events frequently occured one or two times a day. So I've had to kill some java processes to stop Weblogic Server in a normal way. When I looked at OpenCms, Oracle and Weblogic logs there was nothing which referred there. 
To solve the problem, we observed Weblogic and Opencms threads with Eclipse's debug. During Opencms's blocking, two threads remained "blocked". See the end of stacks :

Thread 1 
DriverManager.getDrivers() line: 321 
OracleDriver.connect(String, Properties) line: 297 
CmsPool.createConnection() line: 338 
CmsPool.createConnections(int) line: 320 
CmsPool.putConnection(CmsConnection) line: 301 
CmsConnection.close() line: 384 
CmsDbAccess(CmsDbAccess).readUser(String,int) line: 10208 

Thread 2 
CmsPool.getConnection() line: 218 
CmsPool.connect() line: 206 
CmsDriver.connect(String, Properties) line: 107 
DriverManager.getConnection(String,Properties,ClassLoader) line: 512 
DriverManager.getConnection(String) line: 193 
CmsDbAccess(CmsDbAccess).readGroup(String) line: 8673 

The bold methods are synchronized. We see that the first thread puts an object CmsPool on standby of a connection, which causes to also put an object DriverManager him on standby. During this time the second thread puts the object DriverManager on standby of a connection, which causes to also put the object CmsPool him on standby --> deadlocks
The first thread want to kill the connection because lifespan of connection was exceeded (method putConnection of CmsPool class) :

if((con.getEstablishedTime() + (m_maxage)) < System.currentTimeMillis()) 
{
    // this connection is to old, destroy it and create a new-one!
    alive = false;
}

Lifespan is defined in the opencms.properties file with the name " maxage ". We thus chose to put the greatest possible value for this variable (35790 minutes = approximately 20 days), to limit the cases of connection's closing. This value was selected compared to the greatest possible value for an object of the Integer type and not to cause an error in the pool's creation (method CmsPool(…) of CmsPool class) here :

m_maxage = maxage * 60 * 1000; à with m_maxage : long and maxage : int

So I hope that will help you (and that you understood me...)
Bests regards,
Aurélie Prévit



More information about the opencms-dev mailing list