Re: Use atexit() in initdb and pg_basebackup

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use atexit() in initdb and pg_basebackup
Date: 2019-01-05 15:42:47
Message-ID: 201901051542.macmepgkz3zr@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Jan-05, Peter Eisentraut wrote:

> On 04/01/2019 20:35, Alvaro Herrera wrote:

> >> + /* prevent cleanup */
> >> + made_new_pgdata = found_existing_pgdata = made_new_xlogdir = found_existing_xlogdir = false;
> >> +
> >> return 0;
> >> }
> >
> > This is a bit ugly, but meh.
>
> Yeah. Actually, we already have a solution of this in pg_basebackup,
> with a bool success variable. I rewrote it like that. At least it's
> better for uniformity.

Ah, yeah, much better, LGTM.

> I also added an atexit() conversion in isolationtester. It's mostly the
> same thing.

LGTM in a quick eyeball.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-01-05 17:09:40 Re: BUG #15446: Crash on ALTER TABLE
Previous Message Peter Eisentraut 2019-01-05 15:21:23 Re: [PATCH] Improvements to "Getting started" tutorial for Google Code-in task