Re: CHECK_FOR_INTERRUPTS in spgdoinsert() isn't helpful - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CHECK_FOR_INTERRUPTS in spgdoinsert() isn't helpful
Date
Msg-id 16812.1401396097@sss.pgh.pa.us
Whole thread Raw
In response to Re: CHECK_FOR_INTERRUPTS in spgdoinsert() isn't helpful  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 05/29/2014 11:25 PM, Tom Lane wrote:
>> In point of fact, we'd be happy to give up the locks and then throw
>> the error.  So I was thinking about inventing some macro or out-of-line
>> function that went about like this:
>> 
>> if (InterruptPending && (QueryCancelPending || ProcDiePending))
>> {
>>    LWLockReleaseAll();
>>     ProcessInterrupts();
>>     elog(ERROR, "ProcessInterrupts failed to throw an error");
>> }

> Also checking that CritSectionCount == 0 seems like a good idea...

Yeah, and there may be a couple other details like that.  Right now
I'm just thinking about not allowing LWLocks to block the cancel.
I guess something else to consider is whether InterruptHoldoffCount
could be larger than the number of held LWLocks; if so, that would
prevent this from working as desired.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Extended Prefetching using Asynchronous IO - proposal and patch
Next
From: Tom Lane
Date:
Subject: Re: CHECK_FOR_INTERRUPTS in spgdoinsert() isn't helpful