Re: How to handle waitingForLock in LockWaitCancel() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How to handle waitingForLock in LockWaitCancel()
Date
Msg-id 15997.983772968@sss.pgh.pa.us
Whole thread Raw
In response to How to handle waitingForLock in LockWaitCancel()  (Hiroshi Inoue <Inoue@tpf.co.jp>)
List pgsql-hackers
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> I sometimes encountered SEGV errors in my test case
> when I canceled the execution.

Can you provide backtraces from these SEGVs?

> 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.

I do not like that change at *all*.  In the first place, how could it
stop whatever is causing the SEGV?  The waitingForLock flag is not
examined anywhere else, so unless things are already broken this cannot
have any effect.  In the second place, postponing the reset of the
flag has the potential for an infinite loop, because this routine is
called during error exit.  Suppose LockLockTable causes an elog(ERROR)?

I think we need to look harder to find the cause of the SEGVs you are
seeing.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: How to handle waitingForLock in LockWaitCancel()
Next
From: "Patrick Dunford"
Date:
Subject: Getting unique ID through SQL