pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Andrey <parihaaraka@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: NOTIFY does not work as expected
Date: Thu, 18 Oct 2018 19:07:44 -0400
Message-ID: <31090.1539904064@sss.pgh.pa.us> (raw)
In-Reply-To: <20181018224608.6d4v2fadyu3vrbx2@alap3.anarazel.de>
References: <CAMkU=1ytid9NHkLpOyu9bgLb47L34WX+KQnfU8KmQGAOAFJ_Zg@mail.gmail.com>
	<64711.1530595730@sss.pgh.pa.us>
	<CAMkU=1zXAuV+xW6SVpBc_q6M_h_EFxAQHpi+UFb3k2ZPZ_uO=g@mail.gmail.com>
	<CAMkU=1w68PkRCZLmX+pVc3RdWRyWuRCSw8-g4xvQNwy_1FkVtA@mail.gmail.com>
	<CAMkU=1x5b-JqAp951s8vpSLbwx3DmrVDM_pR1ch79hSmBdoQQA@mail.gmail.com>
	<CAMkU=1yxjDmqpFGMN04EXz86XoQUufQfh5zTscwbvdCikPosEA@mail.gmail.com>
	<20180704183055.hqlqm3ramerybzvd@alap3.anarazel.de>
	<CAMkU=1zCfdxGBcm7N=Twr7bz4KTmYZbEhq=f-VaNmP6d4ry-Tw@mail.gmail.com>
	<CAOYf6edT_0fFAYtnxFiX8b_AEjCn4qcVEH1-F21AedksuWvB5g@mail.gmail.com>
	<29914.1539902374@sss.pgh.pa.us>
	<20181018224608.6d4v2fadyu3vrbx2@alap3.anarazel.de>

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




view thread (24+ messages)  latest in thread

Message-ID: <31090.1539904064@sss.pgh.pa.us>
Permalink:  ../31090.1539904064@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31090.1539904064@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, parihaaraka@gmail.com, jeff.janes@gmail.com
  Subject: Re: NOTIFY does not work as expected
  In-Reply-To: <31090.1539904064@sss.pgh.pa.us>
  References: <CAMkU=1ytid9NHkLpOyu9bgLb47L34WX+KQnfU8KmQGAOAFJ_Zg@mail.gmail.com> <64711.1530595730@sss.pgh.pa.us> <CAMkU=1zXAuV+xW6SVpBc_q6M_h_EFxAQHpi+UFb3k2ZPZ_uO=g@mail.gmail.com> <CAMkU=1w68PkRCZLmX+pVc3RdWRyWuRCSw8-g4xvQNwy_1FkVtA@mail.gmail.com> <CAMkU=1x5b-JqAp951s8vpSLbwx3DmrVDM_pR1ch79hSmBdoQQA@mail.gmail.com> <CAMkU=1yxjDmqpFGMN04EXz86XoQUufQfh5zTscwbvdCikPosEA@mail.gmail.com> <20180704183055.hqlqm3ramerybzvd@alap3.anarazel.de> <CAMkU=1zCfdxGBcm7N=Twr7bz4KTmYZbEhq=f-VaNmP6d4ry-Tw@mail.gmail.com> <CAOYf6edT_0fFAYtnxFiX8b_AEjCn4qcVEH1-F21AedksuWvB5g@mail.gmail.com> <29914.1539902374@sss.pgh.pa.us> <20181018224608.6d4v2fadyu3vrbx2@alap3.anarazel.de> <31090.1539904064@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox