X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 17F175288D for ; Fri, 24 Jun 2005 21:55:03 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72779-03 for ; Sat, 25 Jun 2005 00:55:01 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 96A845288B for ; Fri, 24 Jun 2005 21:55:00 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dlywp-0005Vn-ET; Sat, 25 Jun 2005 12:55:03 +1200 Message-ID: <42BCAB66.3050707@opencloud.com> Date: Sat, 25 Jun 2005 12:55:02 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andres Olarte Cc: pgsql-jdbc@postgresql.org Subject: Re: Problem with Async (multiple) notifications References: <3fccaa6905062416392e578f58@mail.gmail.com> In-Reply-To: <3fccaa6905062416392e578f58@mail.gmail.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/128 X-Sequence-Number: 13090 Andres Olarte wrote: > I've been playing with async notifications lately, and I've found a > small problem: when several notifications are issued at once (for > example within a transaction) normally only one of those gets to the > client. The rest of the notifications are not received until > something happens on the connection, for example a query or another > notification. Ok, this looks like a bug in some newish code that allows you to do this at all (previously, you *always* had to issue a query to notice async notifications). It's checking only for new data available on the underlying socket, and not our input buffer -- if we read multiple notifications into our input buffer, consuming all the data at the socket level, we only process one before returning to the client, and don't look for any more until more data arrives at the socket level. I've applied a fix to CVS HEAD (only org/postgresql/core/PGStream.java affected), can you try that out? -O