Zope hangs with 'idle in transaction'
Hi, list, I have a site running with Zope 2.7.6 under Linux. The site access a PostgreSQL database through ZSQL and psycopg 1.1.18. Only read access is used, nothing is written to the database. The one thing that annoys me very much is, with time passing, Zope will eventually hang and has to be restarted. When I use ps -Af to view the data connection status, I discovered that whenever Zope hangs, I can found all zope database connection in the status 'idle in transaction', like below: postgres 13605 799 0 16:22 ? 00:00:07 postgres: zopeapp backupdb 127.0.0.1 idle in transaction postgres 13611 799 0 16:22 ? 00:00:06 postgres: zopeapp backupdb 127.0.0.1 idle in transaction postgres 13614 799 0 16:22 ? 00:00:00 postgres: zopeapp backupdb 127.0.0.1 idle in transaction postgres 14078 799 0 16:26 ? 00:00:05 postgres: zopeapp backupdb 127.0.0.1 idle in transaction It seems zope is initiating some database transactions even though my site only access the database for reading. And those transaction somehow get into deadlock status and finally used up the maximun db connection allowed for zope. But why? How do I find out what zope is doing and why the connection are locked up? Any clue and direction pointing are heartily appreciated. Regards, -- Hong Yuan 大管家网上建材超市 装修装潢建材一站式购物 http://www.homemaster.cn
Yuan HOng wrote:
It seems zope is initiating some database transactions even though my site only access the database for reading. And those transaction somehow get into deadlock status and finally used up the maximun db connection allowed for zope.
But why? How do I find out what zope is doing and why the connection are locked up?
You can use DeadlockDebugger for that. Florent
Any clue and direction pointing are heartily appreciated.
Regards,
-- Hong Yuan
-- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
Yuan HOng wrote at 2005-10-27 18:18 +0800:
... I have a site running with Zope 2.7.6 under Linux. The site access a PostgreSQL database through ZSQL and psycopg 1.1.18. Only read access is used, nothing is written to the database.
The one thing that annoys me very much is, with time passing, Zope will eventually hang and has to be restarted. When I use ps -Af to view the data connection status, I discovered that whenever Zope hangs, I can found all zope database connection in the status 'idle in transaction', like below:
postgres 13605 799 0 16:22 ? 00:00:07 postgres: zopeapp backupdb 127.0.0.1 idle in transaction postgres 13611 799 0 16:22 ? 00:00:06 postgres: zopeapp backupdb 127.0.0.1 idle in transaction postgres 13614 799 0 16:22 ? 00:00:00 postgres: zopeapp backupdb 127.0.0.1 idle in transaction postgres 14078 799 0 16:26 ? 00:00:05 postgres: zopeapp backupdb 127.0.0.1 idle in transaction
I saw something like this when more than a single database connection was used in the same transaction -- it is a typical database deadlock: some connection locked some resource and later on in the transaction a second connection tried to access the locked resource -- deadlock. Avoid using more than one conntection to the same database in a single transaction! -- Dieter
participants (3)
-
Dieter Maurer -
Florent Guillaume -
Yuan HOng