Re: WaitEventSet resource leakage - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WaitEventSet resource leakage
Date
Msg-id 99040.1700089737@sss.pgh.pa.us
Whole thread Raw
In response to Re: WaitEventSet resource leakage  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: WaitEventSet resource leakage
List pgsql-hackers
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.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: On non-Windows, hard depend on uselocale(3)
Next
From: Andres Freund
Date:
Subject: Re: lazy_scan_heap() should release lock on buffer before vacuuming FSM