Re: Fix resource leaks in pg_receivewal on LZ4 close failures

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Chao Li <li(dot)evan(dot)chao(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-19 07:19:07
Message-ID: CAHGQGwFdQfFgjO5Lv_2gDrHZXBdfg=KHv_nxTwMnQb_hswxBUQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 12, 2026 at 9:36 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
> This call is intended to delete a temporary file, so I don’t think an LZ4F error should prevent that deletion. Maybe fix this leak as well?

Maybe yes, seems we can attempt to unlink the file on error when
CLOSE_UNLINK is specified. This should also cover close() and gzclose()
failures, not just LZ4 finalization or final write failures? If so, I think
a separate patch would be better, since this changes cleanup behavior
beyond the LZ4 resource leak fix.

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-11-19 07:20:51 Block various aggregate component functions from being called directly
Previous Message Fujii Masao 2026-11-19 07:14:21 Re: BUG #19776: pg_combinebackup ignores the truncation_block_length of an intermediate incremental backup