public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Alvaro Herrera <[email protected]>
Cc: Amit Kapila <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: Memory leak in WAL sender with pgoutput (v10~)
Date: Wed, 4 Dec 2024 07:41:19 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAA4eK1+TCM5mqVXG-6VXoptFdc5c2+OMYABrpr4fc1r5f5M0yw@mail.gmail.com>
	<[email protected]>

On Tue, Dec 03, 2024 at 02:45:22PM +0100, Alvaro Herrera wrote:
> We can put the new member at the end of the struct, it shouldn't damage
> anything even if they're using this struct -- which I find pretty
> unlikely.  The only way that could break anything is if somebody is
> allocating/using arrays of it, which sounds even more unlikely.

Yes, that sounds unlikely.  

> If we don't want to accept that risk (for which I see no argument, but
> happy to be proven wrong), I would suggest to use the foreach-pfree
> pattern Michael first proposed for the backbranches, and the new memory
> context in master.  I think this is conducive to better coding overall
> as we clean things up in this area.

Is it really worth betting on nobody doing something that does a
sizeof(PGOutputData) for the stable branches?  People like doing fancy
things, and we would not hear about such problems except if we push
the button making it a possibility because compiled code suddenly
breaks after a minor release update of the core engine.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (5+ messages)

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Memory leak in WAL sender with pgoutput (v10~)
  In-Reply-To: <[email protected]>

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

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