On 2026-Nov-27, Heikki Linnakangas wrote: > I looked at this more closely because it conflicted with my "Interrupts vs > signals" work. I don't see anything wrong, but I started to wonder why we > use the SIGALRM based timers for the standby timeouts, when we're just > sleeping on WaitLatch(). WaitLatch() takes a timeout argument, why don't we > just use that? Would seem much more straightforward.
That sounds reasonable. > Punching through the encapsulation of ProcWaitForSignal() doesn't really > bother me, and in fact with my "Interrupts vs signals" rewrite, the > ProcSendSignal() and ProcWaitForSignal() functions are gone anyway, replaced > by interrupts. But yeah, you could add a timeout argument to > ProcWaitForSignal() instead if you'd prefer. Well, ProcWaitForSignal was added as an abstraction much before we had latches at all -- back then it was paired with ProcSendSignal. I would say it's been half-removed already. I don't think we need to keep it; bare WaitLatch seems fine. > So, what do you think of the attached? (for master only) I didn't review in detail, but the removal looks good. The bit-or'ing of locktag.locktag_type caught my attention, as I don't recall having seen that (though now I see ProcSleep also does it). It's clearly all working as intended, but I think we could document it a bit better. > One side-effect of this is that this no longer calls disable_all_timeouts(). > Another minor issue related to that is being discussed at > https://www.postgresql.org/message-id/cahgqgwfjixytympz6dwoo-g0vdjo1agztma6ctjgc0ptxfz...@mail.gmail.com. > We should fix that separately, this isn't enough to fix that issue, nor does > it make it worse, but I thought I'd mention it. Heh, that patch series seems to have started by touching the same code, but ended up doing something completely different. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest "foo" someone someday shall type "supercalifragilisticexpialidocious" (5th Commandment for C programmers)
