Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.

2021-04-18 Thread Thomas Munro
On Sun, Apr 18, 2021 at 1:28 AM Thomas Munro wrote: > Linux: "Blocked signals are never ignored, since the signal handler > may change by the time it is unblocked." I should add, that's what the source says. The man page for sigpending(2) makes the opposite claim in its NOTES section on my Debia

Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.

2021-04-17 Thread Thomas Munro
On Sat, Apr 17, 2021 at 8:49 AM Tom Lane wrote: > (I would've thought that a SIG_IGN'd signal would be dropped > immediately even if blocked; that's the behavior that dummy_handler > is designed to prevent, and I'm pretty sure that that code is there > because we saw it actually behaving that way

Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.

2021-04-16 Thread Tom Lane
Thomas Munro writes: > On Sat, Apr 17, 2021 at 12:46 AM Tom Lane wrote: >> Is it really necessary to mess with UnBlockSig? > It's necessary to keep it blocked, because, to quote signalfd(2): >Normally, the set of signals to be received via the file descriptor >should be bloc

Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.

2021-04-16 Thread Thomas Munro
On Sat, Apr 17, 2021 at 12:46 AM Tom Lane wrote: > It might be good to extend the comment in postmaster.c though, perhaps > along the lines of "Ignore SIGURG for now. Child processes may change > this (see InitializeLatchSupport), but they will not receive any such > signals until they wait on a

Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.

2021-04-16 Thread Tom Lane
Thomas Munro writes: > Here's a patch to change that. But... on second thoughts, and after > coming up with a commit message to explain the change, I'm not 100% > convinced it's worth committing. You can't get SIGURG without > explicitly asking for it (by setting maybe_sleeping), which makes it

Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.

2021-04-15 Thread Thomas Munro
On Thu, Apr 15, 2021 at 10:50 PM Thomas Munro wrote: > On Thu, Apr 15, 2021 at 2:26 PM Tom Lane wrote: > > It's possible that that argument doesn't apply to the way SIGURG is used > > in this patch, but I don't see a good reason to ignore the convention of > > setting up the handler this way. > >

Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.

2021-04-15 Thread Thomas Munro
On Thu, Apr 15, 2021 at 2:26 PM Tom Lane wrote: > It's possible that that argument doesn't apply to the way SIGURG is used > in this patch, but I don't see a good reason to ignore the convention of > setting up the handler this way. Yeah, will fix. I don't think there is a bug here given the way

Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.

2021-04-14 Thread Tom Lane
Thomas Munro writes: > Use SIGURG rather than SIGUSR1 for latches. I notice that postmaster.c still does #ifdef SIGURG pqsignal_pm(SIGURG, SIG_IGN); /* ignored */ #endif It appears to me that this should now read pqsignal_pm(SIGURG, dummy_handler);/* unused, reserve for ch