Re: WaitOnLock: error on wakeup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rachit Siamwalla <rachit(at)ensim(dot)com>
Cc: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WaitOnLock: error on wakeup
Date: 2001-07-10 14:16:09
Message-ID: 28858.994774569@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rachit Siamwalla <rachit(at)ensim(dot)com> writes:
> Anyone know why I could possibly get this error? This doesn't happen
> deterministically.

It wouldn't, because the problem arises from the interaction of multiple
clients --- AFAIK it is not possible to get that error with only a
single client, no matter what it does.

A good bet is that your code is written to acquire the same locks in
different orders in different cases. Then you can get cases like

Client A Client B;

begin;
lock table a;

... begin;
... lock table b;

lock table b;
-- now A is waiting for B

... lock table a;
-- deadlock

B's second lock attempt will be rejected with

test71=# lock table a;
ERROR: Deadlock detected.
See the lock(l) manual page for a possible cause.

> WaitOnLock: error on wakeup - Aborting this transaction
> NOTICE: Deadlock detected -- See the lock(l) manual page

Apparently you're running an older PG release; that's what the
error report used to look like.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-07-10 14:17:02 Re: Tips performance under solaris
Previous Message Philip Molter 2001-07-10 14:06:07 Re: Performance tuning for linux, 1GB RAM, dual CPU?