pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
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 15:46:08 -0700
Message-ID: <20181018224608.6d4v2fadyu3vrbx2@alap3.anarazel.de> (raw)
In-Reply-To: <29914.1539902374@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>

On 2018-10-18 18:39:34 -0400, Tom Lane wrote:
> Nope :-(.  However, I got around to looking at this problem, and I concur
> with Jeff's diagnosis: the code around ProcessClientReadInterrupt is
> buggy because it does not account for the possibility that the process
> latch was cleared some time ago while unhandled interrupt-pending flags
> remain set.  There are some other issues too:
> 
> 1. ProcessClientWriteInterrupt has the same problem.
> 
> 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.


Greetings,

Andres Freund




view thread (24+ messages)  latest in thread

Message-ID: <20181018224608.6d4v2fadyu3vrbx2@alap3.anarazel.de>
Permalink:  ../20181018224608.6d4v2fadyu3vrbx2@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20181018224608.6d4v2fadyu3vrbx2@alap3.anarazel.de

 · 

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: andres@anarazel.de, tgl@sss.pgh.pa.us, parihaaraka@gmail.com, jeff.janes@gmail.com
  Subject: Re: NOTIFY does not work as expected
  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>

* 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