Re: Fix resource leaks in pg_receivewal on LZ4 close failures

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix resource leaks in pg_receivewal on LZ4 close failures
Date: 2026-11-11 23:34:10
Message-ID: avT7cjvtBh3ciB9E@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 11, 2026 at 06:48:51PM +0900, Fujii Masao wrote:
> I'd like to propose the attached patch to fix file descriptor and
> memory leaks when LZ4 compression finalization or the final write
> fails. Without this fix, repeated failures can cause these resources
> to accumulate.
>
> Thoughts?

That's worth a backpatch to me all the way down to me, where this has
been introduced. This stuff could be run in a loop in a service-like
fashion, bloating the fds on repeated failures.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-11-11 23:42:40 Re: Prevent foreign key references to unlogged partitions
Previous Message Tomas Vondra 2026-11-11 23:33:55 Re: [PATCH] Add RetrieveInstrumentation hook for CustomScan providers