On Wed, Feb 01, 2023 at 10:12:26AM -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
>> On 2023-02-01 16:21:16 +1300, Thomas Munro wrote:
>>> It's always in proc_exit() in StartupProcShutdownHandler(), a SIGTERM
>>> handler which is allowed to call that while in_restore_command is
>>> true.
>
>> Ugh, no wonder we're getting crashes. This whole business seems bogus as
>> hell.
>
> Indeed :-(
Ugh. My bad.
> The fundamental issue is that we have no good way to break out
> of system(), and I think the original idea was that
> in_restore_command would be set *only* for the duration of the
> system() call. That's clearly been lost sight of completely,
> but maybe as a stopgap we could try to get back to that.
+1. I'll produce some patches.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com