diff options
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r-- | src/backend/utils/init/postinit.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 983b237d7a1..66aa7ea61b6 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -1099,18 +1099,24 @@ ShutdownPostgres(int code, Datum arg) static void StatementTimeoutHandler(void) { + int sig = SIGINT; + + /* + * During authentication the timeout is used to deal with + * authentication_timeout - we want to quit in response to such timeouts. + */ + if (ClientAuthInProgress) + sig = SIGTERM; + #ifdef HAVE_SETSID /* try to signal whole process group */ - kill(-MyProcPid, SIGINT); + kill(-MyProcPid, sig); #endif - kill(MyProcPid, SIGINT); + kill(MyProcPid, sig); } /* * LOCK_TIMEOUT handler: trigger a query-cancel interrupt. - * - * This is identical to StatementTimeoutHandler, but since it's so short, - * we might as well keep the two functions separate for clarity. */ static void LockTimeoutHandler(void) |