From: | Andrew Chernow <ac(at)esilo(dot)com> |
---|---|
To: | Magnus Hagander <magnus(at)hagander(dot)net> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Dave Page <dpage(at)pgadmin(dot)org>, Zeugswetter Andreas OSB sIT <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Charlie Savage <cfis(at)savagexi(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED |
Date: | 2008-10-15 17:39:39 |
Message-ID: | 48F62ADB.7080305@esilo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Magnus Hagander wrote:
> Tom Lane wrote:
>> Andrew Chernow <ac(at)esilo(dot)com> writes:
>>> Tom Lane wrote:
>>>> Does fork/exec preserve lock ownership on Windows?
>>> Not to my knowledge. On windows, there is only CreateProcess
>>> (http://msdn.microsoft.com/en-us/library/ms682425.aspx) That doesn't
>>> resemble the behavior of fork or exec at all.
>> Hmm. Now that you mention it, didn't we solve a similar problem by
>> exploiting the behavior where CreateProcess creates a process but
>> doesn't start it running? I'm envisioning
>
> Yes, we're doing this to pass certain handles down to it.
>
>
>> * Create child process in suspended state
>> * Assign it ownership of a lock (can we do that?)
>> * Set it running
>>
>> If the postmaster crashes between steps 1 and 2, then the zombie process
>> doesn't hold a lock, but it will never do anything so it doesn't matter.
>>
>> OTOH, if the postmaster crashes between steps 2 and 3, there's probably
>> no way to restart your database except to reboot ...
>
> Haven't looked through the details (just arrived in Prato), but once the
> process dies, the lock will go away. So there shoul dbe no need to
> reboot, you just need to get rid of all the running (possibly orphaned)
> processes.
>
> //Magnus
>
>
Be careful. From LockFileEx docs:
"However, the time it takes for the operating system to unlock these
locks depends upon available system resources. Therefore, it is
recommended that your process explicitly unlock all files it has locked
when it terminates. If this is not done, access to these files may be
denied if the operating system has not yet unlocked them."
We knows how long it will take for there to be "available system
resources".
--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2008-10-15 17:43:49 | Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED |
Previous Message | Magnus Hagander | 2008-10-15 17:36:07 | Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED |