Fix WaitOnLock() to ensure that the process's "waiting" flag is reset after
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 2 Feb 2008 22:26:17 +0000 (22:26 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 2 Feb 2008 22:26:17 +0000 (22:26 +0000)
commit6f906905b1d3bc6896a929e1b407e1a9d48fcd42
treecbb87d270e413834b6425d7038a86ede2361e1d3
parent9e647a13872a5f34dc0009566925c5c352463780
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.
src/backend/storage/lmgr/lock.c