Alvaro Herrera wrote:
> One problem with the patch is this (new code):
>
> bn = (Backend *) malloc(sizeof(Backend));
> ! if (bn)
> {
> ! bn->pid = StartAutoVacWorker();
> ! bn->is_autovacuum = true;
> ! /* we don't need a cancel key */
>
> ! if (bn->pid > 0)
> ! {
> ! /* FIXME -- unchecked memory allocation here */
> ! DLAddHead(BackendList, DLNewElem(bn));
>
>
> If the palloc() inside DLNewElem fails, we will fail to report a "fork
> failure" to the launcher. I am not sure how serious this is.
Turns out that this problem is not serious at all, because if that
palloc() fails, the whole postmaster will exit with a FATAL out of
memory message.
The problems in the worker code after fork are still an issue though.
--
Alvaro Herrera http://www.amazon.com/gp/registry/DXLWNGRJD34J
"MySQL is a toy compared to PostgreSQL." (Randal L. Schwartz)
(http://archives.postgresql.org/pgsql-general/2005-07/msg00517.php)