Re: WaitEventSet resource leakage
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-hackers@lists.postgresql.org, Alexander Lakhin <exclusion@gmail.com>
Date: 2023-11-15T23:08:57Z
Lists: 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
Commits
-
Fix resource leak when a FDW's ForeignAsyncRequest function fails
- 555276f85940 14.11 landed
- 481d7d1c01c6 15.6 landed
- 501cfd07dac6 16.2 landed
-
Use ResourceOwner to track WaitEventSets.
- 50c67c2019ab 17.0 landed