Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D4FC1634D91 for ; Wed, 26 Aug 2009 21:07:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 62778-01 for ; Thu, 27 Aug 2009 00:07:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 555AC634982 for ; Wed, 26 Aug 2009 21:07:44 -0300 (ADT) Received: from 122-57-44-76.jetstream.xtra.co.nz ([122.57.44.76] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1MgSWi-0003Rr-Sn; Thu, 27 Aug 2009 12:07:40 +1200 Message-ID: <4A95CE4B.5050107@opencloud.com> Date: Thu, 27 Aug 2009 12:07:39 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Maciek Sakrejda CC: pgsql-jdbc@postgresql.org Subject: Re: PGStream synchronization References: <895e58dd0908241736q3575cdc2v461d879c5b5f9dcb@mail.gmail.com> <4A9334C4.2060503@opencloud.com> <895e58dd0908250815m1a8aada0qc9d3f0bde9c7a303@mail.gmail.com> <895e58dd0908250951m1aa4baabnf1695c9e681aa278@mail.gmail.com> <4A946B7A.60408@opencloud.com> <895e58dd0908260201g59762012ka2349eada052ab6d@mail.gmail.com> In-Reply-To: <895e58dd0908260201g59762012ka2349eada052ab6d@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/71 X-Sequence-Number: 19920 Maciek Sakrejda wrote: > I'm not really sure if there's another clean approach, though. I'm > attaching a patch that takes another dirty approach, but other than > the fact that it seems to work, I don't really like it at all. The > basic idea is to cancel whatever you're doing before closing the > connection: if there's an active copy, have the executor send a > CopyFail; otherwise, have the ProtocolConnectionImpl request a query > cancellation. This seems a bit heavyweight because cancelling a query isn't a trivial amount of work, and it'll happen whenever close() is called if I read your patch correctly. 99% of apps are effectively single-threaded so it seems expensive to always do this when it's rarely needed .. -O