Re: NOTIFY does not work as expected - Mailing list pgsql-bugs

From Tom Lane
Subject Re: NOTIFY does not work as expected
Date
Msg-id 31090.1539904064@sss.pgh.pa.us
Whole thread Raw
In response to Re: NOTIFY does not work as expected  (Andres Freund <andres@anarazel.de>)
Responses Re: NOTIFY does not work as expected
List pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> On 2018-10-18 18:39:34 -0400, Tom Lane wrote:
>> 2. I don't believe the "blocked" vs "not-blocked" distinction one bit.
>> At best, it creates race-condition-like changes in behavior depending
>> on exactly when a signal arrives vs when data arrives or is sent.
>> At worst, I think it creates the same problem it's purporting to solve,
>> ie failure to respond to ProcDiePending at all.  I think the
>> before/during/after calls to ProcessClientXXXInterrupt should just all
>> behave the same and always be willing to execute ProcDiePending.

> That distinction was introduced because people (IIRC you actually) were
> worried that we'd be less likely to get error messages out to the
> client. Especially when you check unconditionally before actually doing
> the write, it's going to be far less likely that we are able to send
> something out to the client.

Far less likely than what?  If we got a ProcDie signal we'd more often
than not have handled it long before reaching here.  If we hadn't, though,
we could arrive here with ProcDiePending set but the latch clear, in which
case we fail to honor the interrupt until the client does something.
Don't really think that's acceptable :-(.  I'm also not seeing why it's
okay to commit ProcDie hara-kiri immediately if the socket is
write-blocked but not otherwise --- the two cases are going to look about
the same from the client side.

            regards, tom lane


pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: NOTIFY does not work as expected
Next
From: PG Bug reporting form
Date:
Subject: BUG #15439: Script Error