Re: windows shared memory error - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: windows shared memory error
Date
Msg-id 49FE47AD.6080005@dunslane.net
Whole thread Raw
In response to Re: windows shared memory error  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: windows shared memory error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:
>> The quick try would be to stick a SetLastError(0) in there, just to be
>> sure... Could be worth a try?
>>     
>
> I kinda think we should do that whether or not it can be proven to
> have anything to do with Andrew's report.  It's just like "errno = 0"
> for Unix --- sometimes you have to do it to be sure of whether a
> particular function has thrown an error.
>
>             
>   

I suspect it has little or nothing to do with it in fact. On my (very 
lightly loaded) Vista box a crash with exit code 9 seems to result in a 
consistently problem free restart. I did 200 iterations of the test.

Now presumably we sleep for 1 sec between the CloseHandle() call and the 
CreateFileMapping() call in that code for a reason. We have seen in 
other cases that Windows can take some time after a call has returned 
for some operations to actually complete, and I assume we have a similar 
case here. So, my question is: how do we know that 1 second is enough? 
Was that a wild guess?

I confess I don't have much confidence that just repeating it a few 
times without increasing the sleep interval will necessarily solve the 
problem.

cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: unchecked out of memory in postmaster.c
Next
From: Tom Lane
Date:
Subject: Re: windows shared memory error