Re: WaitEventSet resource leakage - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: WaitEventSet resource leakage
Date
Msg-id d34c3d92-e629-4932-8ff8-e56796883e63@iki.fi
Whole thread Raw
In response to Re: WaitEventSet resource leakage  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WaitEventSet resource leakage
List pgsql-hackers
On 16/11/2023 01:08, Tom Lane wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
>> On 09/03/2023 20:51, Tom Lane wrote:
>>> After further thought that seems like a pretty ad-hoc solution.
>>> We probably can do no better in the back branches, but shouldn't
>>> we start treating WaitEventSets as ResourceOwner-managed resources?
>>> Otherwise, transient WaitEventSets are going to be a permanent
>>> source of headaches.
> 
>> Let's change it so that it's always allocated in TopMemoryContext, but
>> pass a ResourceOwner instead:
>> WaitEventSet *
>> CreateWaitEventSet(ResourceOwner owner, int nevents)
>> And use owner == NULL to mean session lifetime.
> 
> WFM.  (I didn't study your back-branch patch.)

And here is a patch to implement that on master.

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

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: trying again to get incremental backup
Next
From: Alvaro Herrera
Date:
Subject: Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)