Skip to content

Commit 98c120a

Browse files
committed
Revert ill-conceived patch that made elog(FATAL) the same as elog(ERROR)
followed by seeing EOF from client. If we want a safe session-kill capability we will need to write one, not break our error handling mechanism.
1 parent d79dc61 commit 98c120a

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

src/backend/tcop/postgres.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.425 2004/07/27 05:11:03 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.426 2004/07/28 22:05:46 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -2932,10 +2932,7 @@ PostgresMain(int argc, char *argv[], const char *username)
29322932
/*
29332933
* (3) read a command (loop blocks here)
29342934
*/
2935-
if (!in_fatal_exit)
2936-
firstchar = ReadCommand(&input_message);
2937-
else
2938-
firstchar = EOF;
2935+
firstchar = ReadCommand(&input_message);
29392936

29402937
/*
29412938
* (4) disable async signal conditions again.
@@ -3164,8 +3161,7 @@ PostgresMain(int argc, char *argv[], const char *username)
31643161
* Otherwise it will fail to be called during other
31653162
* backend-shutdown scenarios.
31663163
*/
3167-
proc_exit(!in_fatal_exit ? 0 : proc_exit_inprogress ||
3168-
!IsUnderPostmaster);
3164+
proc_exit(0);
31693165

31703166
case 'd': /* copy data */
31713167
case 'c': /* copy done */

src/backend/utils/error/elog.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.142 2004/06/24 21:03:13 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.143 2004/07/28 22:05:46 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -72,8 +72,6 @@ PGErrorVerbosity Log_error_verbosity = PGERROR_VERBOSE;
7272
char *Log_line_prefix = NULL; /* format for extra log line info */
7373
unsigned int Log_destination = LOG_DESTINATION_STDERR;
7474

75-
bool in_fatal_exit = false;
76-
7775
#ifdef HAVE_SYSLOG
7876
char *Syslog_facility; /* openlog() parameters */
7977
char *Syslog_ident;
@@ -444,16 +442,7 @@ errfinish(int dummy,...)
444442
*/
445443
fflush(stdout);
446444
fflush(stderr);
447-
448-
if (in_fatal_exit)
449-
ereport(PANIC, (errmsg("fatal error during fatal exit, giving up")));
450-
451-
/* not safe to longjump */
452-
if (!Warn_restart_ready || proc_exit_inprogress)
453-
proc_exit(proc_exit_inprogress || !IsUnderPostmaster);
454-
455-
/* We will exit the backend by simulating a client EOF */
456-
in_fatal_exit = true;
445+
proc_exit(proc_exit_inprogress || !IsUnderPostmaster);
457446
}
458447

459448
/*

src/include/tcop/tcopprot.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.67 2004/06/11 01:09:22 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.68 2004/07/28 22:05:47 tgl Exp $
1111
*
1212
* OLD COMMENTS
1313
* This file was created so that other c files could get the two
@@ -33,7 +33,6 @@ extern bool InError;
3333
extern CommandDest whereToSendOutput;
3434
extern DLLIMPORT const char *debug_query_string;
3535
extern int max_stack_depth;
36-
extern bool in_fatal_exit;
3736

3837
/* GUC-configurable parameters */
3938

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy