pgsql: Fix WaitOnLock() to ensure that the process's "waiting" flag is - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix WaitOnLock() to ensure that the process's "waiting" flag is
Date
Msg-id 20080202222617.57341754108@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix WaitOnLock() to ensure that the process's "waiting" flag is reset after
erroring out of a wait.  We can use a PG_TRY block for this, but add a comment
explaining why it'd be a bad idea to use it for any other state cleanup.

Back-patch to 8.2.  Prior releases had the same issue, but only with respect
to the process title, which is likely to get reset almost immediately anyway
after the transaction aborts, so it seems not worth changing them.  In 8.2
and HEAD, the pg_stat_activity "waiting" flag could remain set incorrectly
for a long time.

Per report from Gurjeet Singh.

Modified Files:
--------------
    pgsql/src/backend/storage/lmgr:
        lock.c (r1.180 -> r1.181)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lock.c?r1=1.180&r2=1.181)

pgsql-committers by date:

Previous
From: okbob@pgfoundry.org (User Okbob)
Date:
Subject: orafce - orafce: remove 7.4 forgotten code
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix WaitOnLock() to ensure that the process's "waiting" flag is