Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf690acf

Browse files
committed
Async_NotifyHandler must save and restore ImmediateInterruptOK. Fixes
known problem with failure to respond to 'pg_ctl stop -m fast', andprobable problems if SIGINT or SIGTERM arrives while processing aSIGUSR2 interrupt that arrived while waiting for a new client query.
1 parentbb402a0 commitf690acf

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

‎src/backend/commands/async.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.91 2002/09/16 01:24:41 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.92 2003/02/18 02:53:29 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -599,6 +599,16 @@ Async_NotifyHandler(SIGNAL_ARGS)
599599

600600
if (notifyInterruptEnabled)
601601
{
602+
boolsave_ImmediateInterruptOK=ImmediateInterruptOK;
603+
604+
/*
605+
* We may be called while ImmediateInterruptOK is true; turn it off
606+
* while messing with the NOTIFY state. (We would have to save
607+
* and restore it anyway, because PGSemaphore operations inside
608+
* ProcessIncomingNotify() might reset it.)
609+
*/
610+
ImmediateInterruptOK= false;
611+
602612
/*
603613
* I'm not sure whether some flavors of Unix might allow another
604614
* SIGUSR2 occurrence to recursively interrupt this routine. To
@@ -626,6 +636,13 @@ Async_NotifyHandler(SIGNAL_ARGS)
626636
elog(LOG,"Async_NotifyHandler: done");
627637
}
628638
}
639+
640+
/*
641+
* Restore ImmediateInterruptOK, and check for interrupts if needed.
642+
*/
643+
ImmediateInterruptOK=save_ImmediateInterruptOK;
644+
if (save_ImmediateInterruptOK)
645+
CHECK_FOR_INTERRUPTS();
629646
}
630647
else
631648
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp