Re: SIGQUIT handling, redux

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: SIGQUIT handling, redux
Date: 2020-09-11 02:40:06
Message-ID: 320251.1599792006@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I'll take a closer look at the idea of using _exit(1) tomorrow,
> but I'd be pretty hesitant to back-patch that.

Here's a patch for that; it passes light testing, including forcing
the backend through the SIGTERM and timeout code paths. There's
not much to it except for changing the signal handlers, but I did
add a cross-check that no on-exit handlers have been registered
before we get done with using these signal handlers.

I looked briefly at the idea of postponing ProcessStartupPacket
until InitPostgres has set up a fairly normal environment. It
seems like it'd take a fair amount of refactoring. I really
doubt it's worth the effort, even though the result would be
arguably cleaner logic than what we have now.

regards, tom lane

Attachment Content-Type Size
safer-startup-packet-signals-2.patch text/x-diff 7.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-09-11 02:52:56 Re: Inconsistency in determining the timestamp of the db statfile.
Previous Message Justin Pryzby 2020-09-11 02:37:28 Re: Fix for parallel BTree initialization bug