pgsql: Don't let timeout interrupts happen unless ImmediateInterruptOK

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't let timeout interrupts happen unless ImmediateInterruptOK
Date: 2013-12-13 16:50:55
Message-ID: E1VrVx1-0008Mg-27@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't let timeout interrupts happen unless ImmediateInterruptOK is set.

Serious oversight in commit 16e1b7a1b7f7ffd8a18713e83c8cd72c9ce48e07:
we should not allow an interrupt to take control away from mainline code
except when ImmediateInterruptOK is set. Just to be safe, let's adopt
the same save-clear-restore dance that's been used for many years in
HandleCatchupInterrupt and HandleNotifyInterrupt, so that nothing bad
happens if a timeout handler invokes code that tests or even manipulates
ImmediateInterruptOK.

Per report of "stuck spinlock" failures from Christophe Pettus, though
many other symptoms are possible. Diagnosis by Andres Freund.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e8312b4f03315a98a987997e05a6e9d6d8d84ddf

Modified Files
--------------
src/backend/utils/misc/timeout.c | 36 +++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2013-12-13 17:08:32 Re: pgsql: Fix a couple of bugs in MultiXactId freezing
Previous Message Alvaro Herrera 2013-12-13 16:39:20 Re: pgsql: Fix a couple of bugs in MultiXactId freezing