Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faQ1B-0004Kb-5p for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Jul 2018 18:27:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faQ19-0004cz-AO for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Jul 2018 18:27:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faQ19-0004cs-18 for pgsql-bugs@lists.postgresql.org; Tue, 03 Jul 2018 18:27:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faQ16-0007bt-Cg for pgsql-bugs@postgresql.org; Tue, 03 Jul 2018 18:27:09 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w63IR4Wh032687; Tue, 3 Jul 2018 14:27:04 -0400 From: Tom Lane To: Jeff Janes cc: Andrey , Pg Bugs Subject: Re: NOTIFY does not work as expected In-reply-to: References: <64711.1530595730@sss.pgh.pa.us> Comments: In-reply-to Jeff Janes message dated "Tue, 03 Jul 2018 12:53:25 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <65570.1530642424.1@sss.pgh.pa.us> Date: Tue, 03 Jul 2018 14:27:04 -0400 Message-ID: <65571.1530642424@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jeff Janes writes: > Further diagnosis here is that in the "working" case the client receives a > single packet from the server containing both the pg_sleep response, and > async response, in that order, and the client processes both of them. In > the "broken" case, the client receives a single packet from the server > containing the pg_sleep response, and processes it, and then blocks on user > input. The async response is immediately available in the next packet if > the client would ask for it, but the client doesn't do so. This suggests that 4f85fde8e introduced an extra output-flush operation into the code path, ie it must be flushing the output buffer to the client after ReadyForQuery and then again after emitting the Notify. > If I am diagnosing the right problem, this still doesn't seem like a bug to > me. Well, it seems undesirable to me, both because it implies network traffic inefficiency and because clients don't seem to be expecting it. We have another recent complaint that seems to be possibly the same thing, bug #15255. regards, tom lane