Prevent interrupts while reporting non-ERROR elog messages.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Mar 2014 00:59:55 +0000 (20:59 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Mar 2014 00:59:55 +0000 (20:59 -0400)
commitdad55e1e99dcc0c6b2a75722b3f1106bc68c8960
tree173982e1797857301f766a825221d787bc7d83ca
parent7aea1050ebdf21cb0714bfec46d5bba6d85cf3bf
Prevent interrupts while reporting non-ERROR elog messages.

This should eliminate the risk of recursive entry to syslog(3), which
appears to be the cause of the hang reported in bug #9551 from James
Morton.

Arguably, the real problem here is auth.c's willingness to turn on
ImmediateInterruptOK while executing fairly wide swaths of backend code.
We may well need to work at narrowing the code ranges in which the
authentication_timeout interrupt is enabled.  For the moment, though,
this is a cheap and reasonably noninvasive fix for a field-reported
failure; the other approach would be complex and not necessarily
bug-free itself.

Back-patch to all supported branches.
src/backend/utils/error/elog.c