Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session
Date
Msg-id 2521.1284054522@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session  (Magnus Hagander <magnus@hagander.net>)
Responses Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> On Tue, Aug 24, 2010 at 15:58, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Given the existence of the deadman switch mechanism (which I hadn't
>> remembered when this thread started), I'm coming around to the idea that
>> we could just treat exit(128) as nonfatal on Windows. �If for some
>> reason the child hadn't died instantly at startup, the deadman switch
>> would distinguish that from the case described here.

> Just to be clear, do you mean something as simple as this?

That seems like a rather klugy place and way to insert the fix.  One
complaint about it is that the notice won't get logged nicely.  It'd be
better if the main reaper() code was responsible for ignoring 128 so
that it could log the fact that it'd done so in the regular postmaster
log.

Another issue is that "nonfatal" doesn't mean "successful".  In
particular, if this happened for the startup process, or probably some
other cases, taking the exit code as 0 would cause seriously wrong
things to happen.

On balance I think I'd suggest an #ifdef WIN32 in CleanupBackend that
made it accept 128 as a "normal exit" case.  That would allow normal
processing to continue only when this happens to a regular backend,
which is probably sufficient for the purpose.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session
Next
From: Tom Lane
Date:
Subject: Re: returning multiple result sets from a stored procedure