Hi, On 2024-04-12 09:43:46 -0400, Tom Lane wrote: > Andres Freund <and...@anarazel.de> writes: > > Oh my. There's a workload that completely trivially hits this, without even > > trying hard. LISTEN/NOTIFY. > > Hm. Bug in the NOTIFY logic perhaps?
I don't think it's a bug, async.c:SignalBackends() will signal once for every NOTIFY, regardless of whether the target has already been signaled. You're certainly right that: > Sending that many signals can't be good from a performance POV, whether or > not it triggers spinlock issues. I wonder if we could switch this to latches, because with latches we'd only re-send a signal if the receiving end has already processed the signal. Or alternatively, make procsignal.c do something similar, although that might take a bit of work to be done race-free. Greetings, Andres Freund