Re: [PATCH] Re: BUG #16032: pg_basebackup when running on Windowsdoesn't clean up on failure correctly - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: [PATCH] Re: BUG #16032: pg_basebackup when running on Windowsdoesn't clean up on failure correctly
Date
Msg-id 20191007012132.GE14532@paquier.xyz
Whole thread Raw
In response to [PATCH] Re: BUG #16032: pg_basebackup when running on Windows doesn't clean up on failure correctly  (Rob Emery <postgresql@mintsoft.net>)
Responses Re: [PATCH] Re: BUG #16032: pg_basebackup when running on Windows doesn't clean up on failure correctly
List pgsql-bugs
On Sun, Oct 06, 2019 at 08:15:10PM +0100, Rob Emery wrote:
> Hello,
>
> I've already posted this to pg_hackers, but I'm not sure if it's
> more normal to post proposed fixes against the bug itself; so see
> attached if needed.

Discussing patches on -bugs threads is perfectly fine :)

Regarding your patch, anything living in the middle of processing
(basically calling disconnect_and_exit() in ~11 and exit() for 12~)
would fail into this category.  Wouldn't it make sense here to use
atexit() to ensure that the cleanup always happens?  I am not sure
that it is a good idea to hope that anything processing the base
backup COPY chunks will remember to clean up those handles in the
event of an error.  I am ready to bet that any future code will forget
to add that so we would keep falling into the same trap.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Rob Emery
Date:
Subject: [PATCH] Re: BUG #16032: pg_basebackup when running on Windows doesn't clean up on failure correctly
Next
From: Fahar Abbas
Date:
Subject: Re: BUG #16041: Error shows up both in pgAdmin and in Ruby (pg gem) - Segmentation fault