How to handle waitingForLock in LockWaitCancel()

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: How to handle waitingForLock in LockWaitCancel()
Date: 2001-03-05 03:05:16
Message-ID: 3AA3026C.7623B17F@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I sometimes encountered SEGV errors in my test case
when I canceled the execution.
Probably it's due to the almost simultaneous arrival
of multiple signals and the following patch seems to
fix the bug. However I'm afraid that the change should
cause another bug.

Comments ?

Regards,
Hiroshi Inoue

Index: proc.c
===================================================================
RCS file:
/home/projects/pgsql/cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v
retrieving revision 1.98
diff -c -c -r1.98 proc.c
*** proc.c 2001/01/26 18:23:12 1.98
--- proc.c 2001/03/05 02:28:09
***************
*** 327,334 ****
if (!waitingForLock)
return false;

- waitingForLock = false;
-
/* Turn off the deadlock timer, if it's still running (see
ProcSleep) */
#ifndef __BEOS__
{
--- 327,332 ----
***************
*** 345,350 ****
--- 343,349 ----

/* Unlink myself from the wait queue, if on it (might not be
anymore!) *
/
LockLockTable();
+ waitingForLock = false;
if (MyProc->links.next != INVALID_OFFSET)
RemoveFromWaitQueue(MyProc);
UnlockLockTable();

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lu Raymond 2001-03-05 06:02:01 There is error at the examples in PL/pgSQL
Previous Message Patrick Dunford 2001-03-05 00:37:25 Access 97 & PostgreSQL ODBC Driver Problems