pgsql: Block interrupts during HandleParallelMessages().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Block interrupts during HandleParallelMessages().
Date: 2016-08-02 20:39:33
Message-ID: E1bUgTN-0008Ch-QX@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Block interrupts during HandleParallelMessages().

As noted by Alvaro, there are CHECK_FOR_INTERRUPTS() calls in the shm_mq.c
functions called by HandleParallelMessages(). I believe they're all
unreachable since we always pass nowait = true, but it doesn't seem like
a great idea to assume that no such call will ever be reachable from
HandleParallelMessages(). If that did happen, there would be a risk of a
recursive call to HandleParallelMessages(), which it does not appear to be
designed for --- for example, there's nothing that would prevent
out-of-order processing of received messages. And certainly such cases
cannot easily be tested. So let's prevent it by holding off interrupts for
the duration of the function. Back-patch to 9.5 which contains identical
code.

Discussion: <14869(dot)1470083848(at)sss(dot)pgh(dot)pa(dot)us>

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/75c452a755a0c1e1500362b9bd7976a0be2588d2

Modified Files
--------------
src/backend/access/transam/parallel.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2016-08-02 21:13:18 pgsql: doc: OS collation changes can break indexes
Previous Message Tom Lane 2016-08-02 20:09:15 pgsql: Sync 9.5 version of access/transam/parallel.c with HEAD.