Re: Stats collection on Windows

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "stephen joseph butler" <stephen(dot)butler(at)gmail(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Stats collection on Windows
Date: 2006-04-05 14:45:00
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA35256@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> There's a disconnect here. handles aren't process
> identifiers: they're reference counted "pointers" to the
> kernel structures for the process. If you are holding a
> handle (ie: from CreateProcess or OpenProcess) that handle
> cannot and will not be reclaimed until you call CloseHandle
> (or your process itself exits). You should never retain a
> handle after you've called CloseHandle on it.
>
> Which brings an interesting thought: are process ID's
> reclaimed while open handles remain? I'm willing to bet the
> answer is no. In that case, the stats collector could retain
> the handle until it's done with the process ID.

Since the process id lives in the kernel structure they point to, they
can't very well be recycled... (classical
handle-leak-kills-windows-system-by-running-out-of-kernel-space
scenario).

The problem is, the stats collector doesn't have the handle in the first
place. I guess it could open one upon receiving the bestart message, but
it seems like a kludge. Would be nicer if it could be done cleaner :-)

//Magnus

Browse pgsql-hackers by date

  From Date Subject
Next Message Patrick Welche 2006-04-05 14:48:34 Re: float8 regression test failure in head
Previous Message Pavel Stehule 2006-04-05 14:44:12 Re: commit callback, request