Re: [HACKERS] Thoughts about bug #3883

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-patches(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Thoughts about bug #3883
Date: 2008-01-25 23:00:41
Message-ID: 25179.1201302041@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

I wrote:
> No, the problem is merely to get LockWaitCancel to return "true" so that
> StatementCancelHandler will go ahead with the immediate interrupt. No
> new cleanup is needed other than resetting the new flag.

Actually there's a better way to do it: we can remove a little bit of
complexity instead of adding more. The basic problem is that
StatementCancelHandler wants to tell the difference between waiting for
client input (which there is no use for it to interrupt) and other
states in which ImmediateInterruptOK is set. ProcWaitForSignal() is
falling on the wrong side of the classification --- and I argue that any
other newly added interruptable wait would too. We should reverse the
sense of the test so that it's "not in client input" instead of "in lock
wait". At the time that code was written, there wasn't any conveniently
cheap way to check for client input state, so we kluged up
LockWaitCancel to detect the other case. But now that we have the
DoingCommandRead flag, it's easy to check that. This lets us remove
LockWaitCancel's return value (which was always a bit untidy, since all
but one of its callers ignored the result), ending up with exactly
parallel code in die() and StatementCancelHandler(). Seems cleaner than
before.

regards, tom lane

Attachment Content-Type Size
unknown_filename text/plain 10.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2008-01-25 23:22:16 we have out func for typecast, but we missing this read function
Previous Message Simon Riggs 2008-01-25 22:13:52 Re: Proposal: Integrity check

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2008-01-25 23:35:12 sinval contention reduction
Previous Message Tom Lane 2008-01-25 21:16:25 Re: Thoughts about bug #3883