Allow discovery of whether a dynamic background worker is running.
Robert Haas <rhaas@postgresql.org>
Allow discovery of whether a dynamic background worker is running. Using the infrastructure provided by this patch, it's possible either to wait for the startup of a dynamically-registered background worker, or to poll the status of such a worker without waiting. In either case, the current PID of the worker process can also be obtained. As usual, worker_spi is updated to demonstrate the new functionality. Patch by me. Review by Andres Freund.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/worker_spi/worker_spi--1.0.sql | modified | +1 −1 |
| contrib/worker_spi/worker_spi.c | modified | +24 −2 |
| doc/src/sgml/bgworker.sgml | modified | +49 −5 |
| src/backend/commands/async.c | modified | +0 −2 |
| src/backend/postmaster/bgworker.c | modified | +204 −2 |
| src/backend/postmaster/postmaster.c | modified | +52 −0 |
| src/backend/storage/ipc/procsignal.c | modified | +12 −0 |
| src/include/miscadmin.h | modified | +2 −0 |
| src/include/postmaster/bgworker.h | modified | +20 −1 |
| src/include/postmaster/bgworker_internals.h | modified | +2 −0 |
| src/include/postmaster/postmaster.h | modified | +1 −0 |
| src/include/storage/procsignal.h | modified | +1 −0 |