Re: [HACKERS] 'Waiting on lock'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "pgsql-patches" <pgsql-patches(at)postgresql(dot)org>, "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Subject: Re: [HACKERS] 'Waiting on lock'
Date: 2007-06-20 17:13:54
Message-ID: 22218.1182359634@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> I don't see how you arrive at that conclusion. The message is printed
>> by the backend that is waiting for (or just obtained) a lock, dependent
>> on its own local setting of log_lock_waits, and not dependent on who
>> woke it up.

> But in your version of the patch you're not calling PGSemaphoreUnlock() unless
> log_lock_waits is set in the process doing the waking.

Which is always the same process:
PGSemaphoreUnlock(&MyProc->sem);

>> BTW, I just noticed that GUC allows deadlock_timeout to be set all the
>> way down to zero. This seems bad --- surely the minimum value should at
>> least be positive? As CVS HEAD stands, you're likely to get a lot of
>> spurious/useless log messages if you have log_lock_waits = true and
>> deadlock_timeout = 0. Do we care?

> Does that actually work? I would expect setitimer to turn off the alarm in
> that case.

Good point, which renders it definitely broken. I propose we just tweak
GUC to set a minimum deadlock_timeout of 1 msec.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2007-06-20 17:30:54 Re: more autovacuum fixes
Previous Message Gregory Stark 2007-06-20 17:00:16 Re: [HACKERS] 'Waiting on lock'