pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: Improve handling of out-of-memory in libpq.
Date: Tue, 07 Jul 2015 15:50:03 +0000
Message-ID: <E1ZCV8F-0002QO-G4@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Improve handling of out-of-memory in libpq.

If an allocation fails in the main message handling loop, pqParseInput3
or pqParseInput2, it should not be treated as "not enough data available
yet". Otherwise libpq will wait indefinitely for more data to arrive from
the server, and gets stuck forever.

This isn't a complete fix - getParamDescriptions and getCopyStart still
have the same issue, but it's a step in the right direction.

Michael Paquier and me. Backpatch to all supported versions.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2b189c7ec1ffd1e626484621c515285bf5d0d5e3

Modified Files
--------------
src/interfaces/libpq/fe-protocol2.c |   51 ++++++++++++++++++++--------
src/interfaces/libpq/fe-protocol3.c |   63 +++++++++++++++++++++++++----------
2 files changed, 83 insertions(+), 31 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (7+ messages)  latest in thread

Message-ID: <E1ZCV8F-0002QO-G4@gemulon.postgresql.org>
Permalink:  ../E1ZCV8F-0002QO-G4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ZCV8F-0002QO-G4@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Improve handling of out-of-memory in libpq.
  In-Reply-To: <E1ZCV8F-0002QO-G4@gemulon.postgresql.org>
  References: <E1ZCV8F-0002QO-G4@gemulon.postgresql.org>

* 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