Re: [BUGS] BUG #4961: pg_standby.exe crashes with no args - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: [BUGS] BUG #4961: pg_standby.exe crashes with no args
Date
Msg-id 3f0b79eb0908182338r2dedc76g394ecf6a8eb2ba5b@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #4961: pg_standby.exe crashes with no args  (Magnus Hagander <magnus@hagander.net>)
Responses Re: [BUGS] BUG #4961: pg_standby.exe crashes with no args  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Hi,

On Thu, Aug 13, 2009 at 2:24 AM, Magnus Hagander<magnus@hagander.net> wrote:
> Not sure. Potentially pure luck. SIGINT has never *worked*, though, it
> just hasn't crashed.

OK.

> We could implement the same type of check in pg_standby, but it
> requires something like CHECK_FOR_INTERRUPTS. And these interrupts
> won't, by default, cause any kind of interruption of the process. In
> the backend, we interrupt socket calls because we have the socket
> wrapper layer, and nothing else. I don't know how doable this would be
> in pg_standby - does it always block on a single thing where we could
> stick some win32 synchronization code? If it's a single, or limited,
> places we could implement something similar to the backend. But if we
> need to interrupt at arbitrary locations, that's just not possible.

I think that CHECK_FOR_INTERRUPTS should be placed just before
checking the flag 'signaled' which may be enabled by the signal handler.
Here is the pseudo-code.

--------------------       {               /* Check for trigger file or signal first */
CheckForExternalTrigger();
+ #ifdef WIN32
+               CHECK_FOR_INTERRUPTS();
+ #endif /* WIN32 */               if (signaled)               {                       Failover = FastFailover;
--------------------

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: release notes - issue
Next
From: "Albe Laurenz"
Date:
Subject: Re: PQgetlength vs. octet_length()