|
7 | 7 | * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 |
| - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.339 2009/05/14 21:28:35 tgl Exp $ |
| 10 | + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.340 2009/05/15 15:56:39 tgl Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -7790,14 +7790,22 @@ startupproc_quickdie(SIGNAL_ARGS)
|
7790 | 7790 | PG_SETMASK(&BlockSig);
|
7791 | 7791 |
|
7792 | 7792 | /*
|
7793 |
| - * DO NOT proc_exit() -- we're here because shared memory may be |
7794 |
| - * corrupted, so we don't want to try to clean up our transaction. Just |
7795 |
| - * nail the windows shut and get out of town. |
7796 |
| - * |
| 7793 | + * We DO NOT want to run proc_exit() callbacks -- we're here because |
| 7794 | + * shared memory may be corrupted, so we don't want to try to clean up our |
| 7795 | + * transaction. Just nail the windows shut and get out of town. Now that |
| 7796 | + * there's an atexit callback to prevent third-party code from breaking |
| 7797 | + * things by calling exit() directly, we have to reset the callbacks |
| 7798 | + * explicitly to make this work as intended. |
| 7799 | + */ |
| 7800 | + on_exit_reset(); |
| 7801 | + |
| 7802 | + /* |
7797 | 7803 | * Note we do exit(2) not exit(0). This is to force the postmaster into a
|
7798 | 7804 | * system reset cycle if some idiot DBA sends a manual SIGQUIT to a random
|
7799 | 7805 | * backend. This is necessary precisely because we don't clean up our
|
7800 |
| - * shared memory state. |
| 7806 | + * shared memory state. (The "dead man switch" mechanism in pmsignal.c |
| 7807 | + * should ensure the postmaster sees this as a crash, too, but no harm |
| 7808 | + * in being doubly sure.) |
7801 | 7809 | */
|
7802 | 7810 | exit(2);
|
7803 | 7811 | }
|
|
0 commit comments