Re: Checks in RegisterBackgroundWorker.()

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Checks in RegisterBackgroundWorker.()
Date: 2023-09-19 15:47:40
Message-ID: b4b8afbf-11ae-fb0b-dd13-e487907cfbd5@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25/08/2023 00:00, Thomas Munro wrote:
> On Fri, Aug 25, 2023 at 3:15 AM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>> In summary, RegisterBackgroundWorker() is doing some questionable and
>> useless work, when a shared preload library is loaded to a backend
>> process in EXEC_BACKEND mode.
>
> Yeah. When I was working on 7389aad6 ("Use WaitEventSet API for
> postmaster's event loop."), I also tried to move all of the
> postmaster's state variables into PostmasterContext (since the only
> reason for that scope was the signal handler code that is now gone),
> and I hit a variant of this design problem. I wonder if that would be
> unblocked by this...
>
> https://www.postgresql.org/message-id/CA+hUKGKH_RPAo=NgPfHKj--565aL1qiVpUGdWt1_pmJehY+dmw@mail.gmail.com

A-ha, yes I believe this patch will unblock that.
RegisterBackgroundWorker() has no legit reason to access
BackgroundWorkerList in child processes, and with these patches, it no
longer does.

--
Heikki Linnakangas
Neon (https://neon.tech)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-09-19 16:09:09 Re: Disabling Heap-Only Tuples
Previous Message Robert Haas 2023-09-19 15:41:14 Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }