Re: Avoid handle leak (src/bin/pg_ctl/pg_ctl.c)

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid handle leak (src/bin/pg_ctl/pg_ctl.c)
Date: 2025-10-24 18:36:50
Message-ID: AB023E38-8014-425B-A208-94BBE72F95E6@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 24 Oct 2025, at 14:40, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
> Em sex., 24 de out. de 2025 às 09:24, Álvaro Herrera <alvherre(at)kurilemu(dot)de <mailto:alvherre(at)kurilemu(dot)de>> escreveu:

>> Hmm? That makes no sense. Do you have references to documentation that
>> says the system works the way you claim?
> There are a bunch of messages on the web.
> Some are:
> "insufficient system resources exist to complete the requested service"

None of the these links back up the claim that exit() wont release resources
under Windows. The "Terminating a Process" article on MSDN does however have
this to say about the subject:

Terminating a process has the following results:

* Any remaining threads in the process are marked for termination.
* Any resources allocated by the process are freed.
* All kernel objects are closed.
* The process code is removed from memory.
* The process exit code is set.
* The process object is signaled.

--
Daniel Gustafsson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-10-24 18:42:24 Re: Unused variable in perl test
Previous Message Masahiko Sawada 2025-10-24 18:35:41 Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array