Re: common signal handler protection

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, noah(at)leadboat(dot)com
Subject: Re: common signal handler protection
Date: 2023-11-29 03:16:52
Message-ID: 20231129031652.GB479372@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 28, 2023 at 06:37:50PM -0800, Andres Freund wrote:
> For a moment I was, wrongly, worried this would break signal handlers we
> intentionally inherit from postmaster. It's fine though, because we block
> signals in fork_process() until somewhere in InitPostmasterChild(), after
> we've called InitProcessGlobals(). But perhaps that should be commented upon
> somewhere?

Good call. I expanded on the MyProcPid assertion in wrapper_handler() a
bit.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v4-0001-Check-that-MyProcPid-getpid-in-all-signal-handler.patch text/x-diff 4.7 KB
v4-0002-Centralize-logic-for-restoring-errno-in-signal-ha.patch text/x-diff 10.4 KB
v4-0003-Revert-Avoid-calling-proc_exit-in-processes-forke.patch text/x-diff 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2023-11-29 04:17:58 Re: Synchronizing slots from primary to standby
Previous Message Peter Smith 2023-11-29 03:04:22 Re: Synchronizing slots from primary to standby