pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: PQexec() hangs on OOM
Date: Tue, 07 Jul 2015 19:01:26 +0300
Message-ID: <559BF7D6.1070906@iki.fi> (raw)
In-Reply-To: <CAB7nPqT4_LD+LE-t-JAL-rhr8QrYO4AgY-j2jnLcSv-n3GYpOw@mail.gmail.com>
References: <547480DE.4040408@vmware.com>
	<CAB7nPqR8UtXpTOkKOuxhhXM8PzcPa4dQDKE6rYx+tZhPrQQNWg@mail.gmail.com>
	<CAB7nPqSb3RF=s+BDyq1Un2+rng20EQQyxajdTRtpRG7XsyuLnw@mail.gmail.com>
	<25150.1428328002@sss.pgh.pa.us>
	<CAB7nPqQPaDb+=GCkdZb1L-VbpJTiigPx9_UNTA1a4H2MLGi9XA@mail.gmail.com>
	<552427FC.6060302@iki.fi>
	<CAB7nPqTqJmUL_jmATPvXzfET9u6DFQxtvF2J74D7XO6QebyAEw@mail.gmail.com>
	<5526BA0A.4090600@iki.fi>
	<CAB7nPqQBPSwz+g2BN5HQyUiMEUY-Scr9jm7RyBSOeo00HFo3gw@mail.gmail.com>
	<87wq03rz1t.fsf@ashulgin01.corp.ad.zalando.net>
	<CAB7nPqT1TVnaKgfoXE7fgKhvL6-ibDWTj1BQT3TjEgp60_cH0A@mail.gmail.com>
	<5596B924.6020307@iki.fi>
	<CAB7nPqSm57dvLyQsCf7+owgiNxK_sGfyFp3OdVj=YS3kRbTMqA@mail.gmail.com>
	<559AB74A.6070602@iki.fi>
	<CAB7nPqRROGvaiL0hzwum0+7EQjQij1u9am4pFnG54GzVdegs2g@mail.gmail.com>
	<CAB7nPqT4_LD+LE-t-JAL-rhr8QrYO4AgY-j2jnLcSv-n3GYpOw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 07/07/2015 09:32 AM, Michael Paquier wrote:
> On Tue, Jul 7, 2015 at 3:31 PM, Michael Paquier
> <michael.paquier@gmail.com> 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



view thread (48+ messages)  latest in thread

Message-ID: <559BF7D6.1070906@iki.fi>
Permalink:  ../559BF7D6.1070906@iki.fi/
Also on:    postgresql.org/message-id/559BF7D6.1070906@iki.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hlinnaka@iki.fi, michael.paquier@gmail.com, oleksandr.shulgin@zalando.de, tgl@sss.pgh.pa.us
  Subject: Re: PQexec() hangs on OOM
  In-Reply-To: <559BF7D6.1070906@iki.fi>
  References: <547480DE.4040408@vmware.com> <CAB7nPqR8UtXpTOkKOuxhhXM8PzcPa4dQDKE6rYx+tZhPrQQNWg@mail.gmail.com> <CAB7nPqSb3RF=s+BDyq1Un2+rng20EQQyxajdTRtpRG7XsyuLnw@mail.gmail.com> <25150.1428328002@sss.pgh.pa.us> <CAB7nPqQPaDb+=GCkdZb1L-VbpJTiigPx9_UNTA1a4H2MLGi9XA@mail.gmail.com> <552427FC.6060302@iki.fi> <CAB7nPqTqJmUL_jmATPvXzfET9u6DFQxtvF2J74D7XO6QebyAEw@mail.gmail.com> <5526BA0A.4090600@iki.fi> <CAB7nPqQBPSwz+g2BN5HQyUiMEUY-Scr9jm7RyBSOeo00HFo3gw@mail.gmail.com> <87wq03rz1t.fsf@ashulgin01.corp.ad.zalando.net> <CAB7nPqT1TVnaKgfoXE7fgKhvL6-ibDWTj1BQT3TjEgp60_cH0A@mail.gmail.com> <5596B924.6020307@iki.fi> <CAB7nPqSm57dvLyQsCf7+owgiNxK_sGfyFp3OdVj=YS3kRbTMqA@mail.gmail.com> <559AB74A.6070602@iki.fi> <CAB7nPqRROGvaiL0hzwum0+7EQjQij1u9am4pFnG54GzVdegs2g@mail.gmail.com> <CAB7nPqT4_LD+LE-t-JAL-rhr8QrYO4AgY-j2jnLcSv-n3GYpOw@mail.gmail.com> <559BF7D6.1070906@iki.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox