Andres Freund <> writes:
> On 2014-09-29 18:44:34 -0300, Alvaro Herrera wrote:
>> As far as I recall, the rationale for why this is acceptable is that the
>> whole of postmaster is run with signals blocked; they are only unblocked
>> during the sleeping select().

> Yea, I wrote that above :). Still seems remarkably fragile and
> unnecessarily complex. The whole thing would be much simpler and
> importantly easier to understand if everything would be done inside the
> mainloop and the handlers just would set a latch...

Actually, I rather doubt that it would be either simpler or easier to
understand.  The reason to think about changing it, IMO, is the fear that
sooner or later we're going to file a bug against some platform's libc and
they're going to tell us to get lost because POSIX says that such-and-such
a library call isn't supported inside a signal handler.

> But I guess that'd be a bit of large change to something as central as
> postmaster's code..

Yeah.  It's a bit scary to consider changing this just to head off a
hypothetical portability problem, especially of a class that we've not
*actually* tripped across in nigh twenty years.  The closest thing that
I've seen to that is the valgrind bug we hit awhile back,

                        regards, tom lane

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to