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

From Tom Lane
Subject Re: archive_command failures report confusing exit status
Date
Msg-id 5832.1197403611@sss.pgh.pa.us
Whole thread Raw
In response to Re: archive_command failures report confusing exit status  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: archive_command failures report confusing exit status  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Am Dienstag, 11. Dezember 2007 schrieb Tom Lane:
>> 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.

No, you are confusing the cases "called shell was killed by a signal"
and "called command was killed by a signal, which the shell then turned
around and reported to us as exit > 128".

> I have tested this:

A single test case proves little.  You need to consider race conditions
and cases where the shell is ignoring the particular signal.  I'm fairly
certain that both of these exit statuses can happen in practice, at
least with some shells/platforms.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: WORM and Read Only Tables (v0.1)
Next
From: Tom Lane
Date:
Subject: Re: psql \dFp's behavior