Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Allow interrupting GetMultiXactIdMembers
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 14 Nov 2014 18:14:01 +0000 (15:14 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 14 Nov 2014 18:14:01 +0000 (15:14 -0300)
This function has a loop which can lead to uninterruptible process
"stalls" (actually infinite loops) when some bugs are triggered.  Avoid
that unpleasant situation by adding a check for interrupts in a place
that shouldn't degrade performance in the normal case.

Backpatch to 9.3.  Older branches have an identical loop here, but the
aforementioned bugs are only a problem starting in 9.3 so there doesn't
seem to be any point in backpatching any further.

src/backend/access/transam/multixact.c

index bfbe738530e7bfd4b5d8c2e967ad48717d08ea4c..3c20bb37e4c590c31b8e05a3f8efd297e44856ce 100644 (file)
@@ -1278,6 +1278,7 @@ retry:
        {
            /* Corner case 2: next multixact is still being filled in */
            LWLockRelease(MultiXactOffsetControlLock);
+           CHECK_FOR_INTERRUPTS();
            pg_usleep(1000L);
            goto retry;
        }