Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group