Received: from mx6.port.ru (mx6.port.ru [194.67.57.16]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBCMpCm86176 for ; Wed, 12 Dec 2001 17:51:12 -0500 (EST) (envelope-from joseph_a@mail.ru) Received: from f9.int ([10.0.0.77] helo=f9.mail.ru) by mx6.port.ru with esmtp (Exim 3.14 #1) id 16EIDU-0001d7-00 for pgsql-general@postgresql.org; Thu, 13 Dec 2001 01:51:08 +0300 Received: from mail by f9.mail.ru with local (Exim 3.14 #1) id 16EIDU-000Dta-00 for pgsql-general@postgresql.org; Thu, 13 Dec 2001 01:51:08 +0300 Received: from [213.226.132.107] by koi.mail.ru with HTTP; Thu, 13 Dec 2001 01:51:08 +0300 From: "Joseph Artsimovich" To: pgsql-general@postgresql.org Cc: Subject: undetected deadlock Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: 192.168.4.75 via proxy [213.226.132.107] Date: Thu, 13 Dec 2001 01:51:08 +0300 Reply-To: "Joseph Artsimovich" Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: X-Archive-Number: 200112/459 X-Sequence-Number: 18558 Hi, I had a problem in my program (used the wrong mode for locking), which caused undetected deadlocks. When I tried to reproduce the problem, I did the following: 1. Create the test table and insert some rows there. 2. Start 2 psql sessions. 3. Execute "begin; lock table test in share mode;" in each session. 4. Execute "update test set data='something'" in each session. On step 4 (1st session) I've got an undetected deadlock. The processes' states were "idle waiting" and "idle in transatcion". The most interesting thing is that I've done the same test before, and then the deadlock was detected on step 4 (2nd session). Restarting postgres does not change anything, the deadlock is still not detected. I use Postgresql 7.1.3 on RedHat 7.1. My original problematic program can be downloaded from here: http://www.dkd.lt/~joseph/test.tar.gz It's a database session handler written in php. To trigger the problem, run: ab -n 100 -c 10 http://yourhost/path_to_the_program/index.php