Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1We7uT-0005DE-N1 for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Apr 2014 19:05:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1We7uT-0002UV-6x for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Apr 2014 19:05:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WdyEe-0001kj-3N for pgsql-bugs@postgresql.org; Sat, 26 Apr 2014 08:45:24 +0000 Received: from mail-ee0-x22e.google.com ([2a00:1450:4013:c00::22e]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WdyEY-0006eX-Km for pgsql-bugs@postgresql.org; Sat, 26 Apr 2014 08:45:23 +0000 Received: by mail-ee0-f46.google.com with SMTP id t10so3293730eei.5 for ; Sat, 26 Apr 2014 01:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xph8Si+qxTPaddZUsuLm8E83/QFXF+mr5kP9y7QsIuk=; b=kC1gRLq2TzZ3SgIfsLVfXSVTCc1KORSZ5+jjy7/4C0WPWa44h+IH/wbb41qO+u3HnT y7+8UZBB/0KERY9QHNTWo//Am/R3j8TTNezwmv06dMnnYtah+Y4vuJacdw2YLAv8CKtZ Sq2YfYioL4AuZIn7ugV55HXbuVoLMgdwuUUPzm3J/5lvEs4aRPESrc9uaDxfYG7mRnSV nJacQl9hDJ2eWVJFfhUmrG5RwGbjvlsPAkWYjYrWijh+dZNMoZMMYJapJiHX2kwYtni/ 0emHj5eDluIemj8RtlrLpyGYeAZWYYLGao+guTLPBrHN4BRRvH7J3MydsHdx5Xb79AdK vEbw== X-Received: by 10.15.32.206 with SMTP id a54mr2172477eev.51.1398501916723; Sat, 26 Apr 2014 01:45:16 -0700 (PDT) Received: from [192.168.1.185] ([134.17.134.128]) by mx.google.com with ESMTPSA id x45sm31590600eeu.23.2014.04.26.01.45.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Apr 2014 01:45:13 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: BUG #10141: Server fails to send query result. From: Evgen Bodunov In-Reply-To: <4892048A-2D47-44FD-94E1-B3AA7B6A55BF@gmail.com> Date: Sat, 26 Apr 2014 11:45:11 +0300 Cc: Stephen Frost , pgsql-bugs@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20140425155227.2715.56833@wrigleys.postgresql.org> <20140425182142.GQ2556@tamriel.snowman.net> <13193.1398453615@sss.pgh.pa.us> <4892048A-2D47-44FD-94E1-B3AA7B6A55BF@gmail.com> To: Tom Lane X-Mailer: Apple Mail (2.1874) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hello guys,=20 I checked it with direct ethernet connection and now it works without issue= s. When i switched OpenVPN server from "proto udp=94 to =93proto tcp" mode = it seems also works ok. Thanks for your help. Best Regards, Evgen Bodunov. On Apr 25, 2014, at 11:55 PM, Evgen Bodunov wrote: > There is more details: >=20 > Even when it works it sends D more than once usually >=20 > From backend> D > From backend (#4)> 33170 > From backend> D > From backend (#4)> 33170 > From backend> D > From backend (#4)> 33170 > From backend> D > From backend (#4)> 33170 > From backend> D > From backend (#4)> 33170 > From backend (#2)> 2 > From backend (#4)> 33132 > From backend (33132)> \x01060000006c0000000103000000010000000a00000080ce2= 6eb13eaa640003fad1864359840800c2b00bdeea6400055d > From backend (#4)> 24 > From backend (24)> "landuse"=3D>"residential" >=20 > My query looks like > select * from poly9(3130860.6785608195, 7592337.1455099881, 3209132.19552= 48402, 7670608.6624740083); >=20 > while poly9 is function generated by app before data processing starts. A= nd basically it looks like: >=20 > CREATE FUNCTION "public"."poly9"(IN minx numeric, IN miny numeric, IN max= x numeric, IN maxy numeric)=20 > returns table (geom_out bytea, tags_out public.hstore)=20 > AS $BODY$ > declare > bbox =3D st_makebox2d(st_makepoint(minx, miny), st_makepoint(maxx, maxy)); > begin > -- simplified version > return query > SELECT way, tags FROM planet_polygon WHERE way && bbox;=20 > end; > $BODY$ > LANGUAGE plpgsql > COST 100 > ROWS 1000 > CALLED ON NULL INPUT > SECURITY INVOKER > VOLATILE; >=20 > Hope it helps. This solution worked fine 2 months ago. Is there a small c= hance that something broken inside 9.3.4? >=20 > Best Regards, > Evgen Bodunov. >=20 > On Apr 25, 2014, at 10:20 PM, Tom Lane wrote: >=20 >> Stephen Frost writes: >>> * molind@gmail.com (molind@gmail.com) wrote: >>>> I added PQtrace for each thread and wait for stuck thread. There is tr= ace: >>=20 >>>> From backend> D >>>> From backend (#4)> 139891 >>>> From backend> D >>>> From backend (#4)> 139891 >>>> From backend> D >>>> From backend (#4)> 139891 >>>> From backend> D >>>> From backend (#4)> 139891 >>>> From backend> D >>>> From backend (#4)> 139891 >>>> From backend> D >>>> From backend (#4)> 139891 >>=20 >> FWIW, this looks suspiciously like libpq is unable to consume data from >> its input buffer (and keeps retrying to process the same data). Are you >> using PQsetnonblocking by any chance? If so, this probably indicates >> failure to follow the required call sequencing to process data. >>=20 >> Another likely theory, given that you mentioned multiple client threads, >> is that the threads are stomping on each others' toes somehow. libpq >> does not defend itself against that: it's up to you to be sure that >> only one thread is touching each PGconn object. >>=20 >>>> Seems problem somewhere inside PostgreSQL. It tries to send result but >>>> fails. >>=20 >>> I don't see anything here which shows that to be the case. >>=20 >> Indeed. I'd bet considerable money that this is a client-side issue. >> It's possible that it's a libpq bug, but what seems more likely is >> that you're using libpq improperly. >>=20 >> regards, tom lane >=20 --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs