Re: archive_command failures report confusing exit status - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: archive_command failures report confusing exit status
Date
Msg-id 200712111903.04709.peter_e@gmx.net
Whole thread Raw
In response to Re: archive_command failures report confusing exit status  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: archive_command failures report confusing exit status  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Am Dienstag, 11. Dezember 2007 schrieb Tom Lane:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Better patch.
>
> Doesn't this patch break the behavior that is documented in the comment?
> Specifically, the case where the restore_command dies on a signal and
> this is reported to us by the controlling shell as exitcode > 128.
> We want the archiver to die, but this patch makes it not do so.

AFAICT, the coding

WIFSIGNALED(rc) || WEXITSTATUS(rc) > 128

is simply redundant, because a signal happened exactly when WIFSIGNALED(rc) is 
true.

I have tested this:

LOG:  database system was shut down at 2007-12-11 17:15:43 CET
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections
FATAL:  archive command was terminated by signal 1: Hangup
DETAIL:  The archive command was "kill -1 $$".
LOG:  archiver process (PID 22572) exited with exit code 1

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: archive_command failures report confusing exit status
Next
From: Andrew Chernow
Date:
Subject: Re: PGparam proposal