1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Remove bgw_sighup and bgw_sigterm.

Per discussion on pgsql-hackers, these aren't really needed.  Interim
versions of the background worker patch had the worker starting with
signals already unblocked, which would have made this necessary.
But the final version does not, so we don't really need it; and it
doesn't work well with the new facility for starting dynamic background
workers, so just rip it out.

Also per discussion on pgsql-hackers, back-patch this change to 9.3.
It's best to get the API break out of the way before we do an
official release of this facility, to avoid more pain for extension
authors later.
This commit is contained in:
Robert Haas
2013-07-22 14:13:00 -04:00
parent 0518eceec3
commit f40a318eea
5 changed files with 3 additions and 35 deletions

View File

@ -247,8 +247,6 @@ BackgroundWorkerStateChange(void)
rw->rw_worker.bgw_restart_time = slot->worker.bgw_restart_time;
rw->rw_worker.bgw_main = slot->worker.bgw_main;
rw->rw_worker.bgw_main_arg = slot->worker.bgw_main_arg;
rw->rw_worker.bgw_sighup = slot->worker.bgw_sighup;
rw->rw_worker.bgw_sigterm = slot->worker.bgw_sigterm;
/* Initialize postmaster bookkeeping. */
rw->rw_backend = NULL;

View File

@ -5357,17 +5357,8 @@ do_start_bgworker(void)
pqsignal(SIGUSR1, bgworker_sigusr1_handler);
pqsignal(SIGFPE, SIG_IGN);
}
/* SIGTERM and SIGHUP are configurable */
if (worker->bgw_sigterm)
pqsignal(SIGTERM, worker->bgw_sigterm);
else
pqsignal(SIGTERM, bgworker_die);
if (worker->bgw_sighup)
pqsignal(SIGHUP, worker->bgw_sighup);
else
pqsignal(SIGHUP, SIG_IGN);
pqsignal(SIGTERM, bgworker_die);
pqsignal(SIGHUP, SIG_IGN);
pqsignal(SIGQUIT, bgworker_quickdie);
InitializeTimeouts(); /* establishes SIGALRM handler */

View File

@ -53,7 +53,6 @@
typedef void (*bgworker_main_type) (Datum main_arg);
typedef void (*bgworker_sighdlr_type) (SIGNAL_ARGS);
/*
* Points in time at which a bgworker can request to be started
@ -79,8 +78,6 @@ typedef struct BackgroundWorker
char bgw_library_name[BGW_MAXLEN]; /* only if bgw_main is NULL */
char bgw_function_name[BGW_MAXLEN]; /* only if bgw_main is NULL */
Datum bgw_main_arg;
bgworker_sighdlr_type bgw_sighup;
bgworker_sighdlr_type bgw_sigterm;
} BackgroundWorker;
/* Register a new bgworker during shared_preload_libraries */