Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCVJS-0002Xy-5I for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jul 2015 16:01:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZCVJR-0001RR-LQ for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jul 2015 16:01:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZCVJQ-0001RH-S8 for pgsql-bugs@postgresql.org; Tue, 07 Jul 2015 16:01:37 +0000 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZCVJK-0005TV-94 for pgsql-bugs@postgresql.org; Tue, 07 Jul 2015 16:01:36 +0000 Received: by wibdq8 with SMTP id dq8so187715462wib.1 for ; Tue, 07 Jul 2015 09:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=z39Fs2qy0TYyYx5QcowFBY7MWuvTQ+6S10+cJkHXWV8=; b=hjBkputgsGxASM1aFYp92nBi+SNBE66fdhfhFHsHMbp0MhxPNBwouPfZGBpXfIXpB9 q1ZCGS8TguxfW74gpEbdkX7SMWu+sHtNwyUDa7uB1F4ePoZbW+ZYhx/u33KESYYRujc7 jytLB2WkiQ8/EGwTI83iNzVhffP+TNX0TbttBVVPpNLzQ+nlyk+IP+91rdFCBRhavvqj D7gPRR7L2ippkIJbd1Hb3mgM2WMt1tS39D9dCICj0dq3DJ98VuDAqTGs2zXhCWPwe9/2 vixjy5oFnVeG/Jchrx3PcNkLVgYgt2Jbh2ulvypP0AWgqOP9lRyZU9kZKJ2R0tOTbZV7 nlzQ== X-Received: by 10.180.75.15 with SMTP id y15mr95358772wiv.51.1436284889482; Tue, 07 Jul 2015 09:01:29 -0700 (PDT) Received: from [192.168.1.110] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by mx.google.com with ESMTPSA id x10sm34038553wjr.25.2015.07.07.09.01.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 09:01:28 -0700 (PDT) Message-ID: <559BF7D6.1070906@iki.fi> Date: Tue, 07 Jul 2015 19:01:26 +0300 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Michael Paquier CC: Oleksandr Shulgin , Tom Lane , Pg Bugs Subject: Re: PQexec() hangs on OOM References: <547480DE.4040408@vmware.com> <25150.1428328002@sss.pgh.pa.us> <552427FC.6060302@iki.fi> <5526BA0A.4090600@iki.fi> <87wq03rz1t.fsf@ashulgin01.corp.ad.zalando.net> <5596B924.6020307@iki.fi> <559AB74A.6070602@iki.fi> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.4 (--) 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 On 07/07/2015 09:32 AM, Michael Paquier wrote: > On Tue, Jul 7, 2015 at 3:31 PM, Michael Paquier > wrote: >> On Tue, Jul 7, 2015 at 2:13 AM, Heikki Linnakangas wrote: >>> The getParamDescriptions() changes were slightly broken. It didn't read the >>> whole input message with pqGetInt() etc., so pqParseInput3() threw the >>> "message contents do not agree with length in message type" error. I started >>> fixing that, by changing the error handling in that function to be more like >>> that in getRowDescriptions(), but then I realized that all the EOF return >>> cases in the pqParseInput3() subroutines are actually dead code. >>> pqParseInput3() always reads the whole message, before passing it on to the >>> right subroutine. That was documented for getRowDescriptions() and >>> getAnotherTuple(), but the rest of the functions were more like the protocol >>> version 2 code, prepared to deal with incomplete messages. I think it would >>> be good to refactor that, removing the EOF return cases altogether. So I >>> left out that change for now as well. >> >> Yes, (the latter case is not actually used currently). Well, I don't >> mind writing the additional patch to update . On top of that The >> refactoring should be a master-only change, perhaps? > > I pushed the send button too early. > I don't mind writing the additional patch for the other routines, > patch that should be backpatched, and the refactoring patch > (master-only?). Ok, committed and backpatched the latest patch I posted. Yeah, we'll need additional patches for the refactoring and the remaining issues. I'm not sure if it's worth trying to backpatch them; let's see how big the patch is. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs