diff options
author | Noah Misch <noah@leadboat.com> | 2021-06-14 17:29:37 -0700 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2021-06-14 17:29:37 -0700 |
commit | 5f1df62a459b51ab3bb625a0ee5e655429254257 (patch) | |
tree | 8d8fcdab616967f0da00376efa902b96fa90055d /src/backend/storage | |
parent | 0aac73e6a2602696d23aa7a9686204965f9093dc (diff) | |
download | postgresql-5f1df62a459b51ab3bb625a0ee5e655429254257.tar.gz postgresql-5f1df62a459b51ab3bb625a0ee5e655429254257.zip |
Remove pg_wait_for_backend_termination().
It was unable to wait on a backend that had already left the procarray.
Users tolerant of that limitation can poll pg_stat_activity. Other
users can employ the "timeout" argument of pg_terminate_backend().
Reviewed by Bharath Rupireddy.
Discussion: https://postgr.es/m/20210605013236.GA208701@rfd.leadboat.com
Diffstat (limited to 'src/backend/storage')
-rw-r--r-- | src/backend/storage/ipc/signalfuncs.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/backend/storage/ipc/signalfuncs.c b/src/backend/storage/ipc/signalfuncs.c index 0a111ad6daa..43386c5bb32 100644 --- a/src/backend/storage/ipc/signalfuncs.c +++ b/src/backend/storage/ipc/signalfuncs.c @@ -231,42 +231,6 @@ pg_terminate_backend(PG_FUNCTION_ARGS) } /* - * Wait for a backend process with the given PID to exit or until the given - * timeout milliseconds occurs. Returns true if the backend has exited. On - * timeout a warning is emitted and false is returned. - * - * We allow any user to call this function, consistent with any user being - * able to view the pid of the process in pg_stat_activity etc. - */ -Datum -pg_wait_for_backend_termination(PG_FUNCTION_ARGS) -{ - int pid; - int64 timeout; - PGPROC *proc = NULL; - - pid = PG_GETARG_INT32(0); - timeout = PG_GETARG_INT64(1); - - if (timeout <= 0) - ereport(ERROR, - (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - errmsg("\"timeout\" must not be negative or zero"))); - - proc = BackendPidGetProc(pid); - - if (proc == NULL) - { - ereport(WARNING, - (errmsg("PID %d is not a PostgreSQL server process", pid))); - - PG_RETURN_BOOL(false); - } - - PG_RETURN_BOOL(pg_wait_until_termination(pid, timeout)); -} - -/* * Signal to reload the database configuration * * Permission checking for this function is managed through the normal |