Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session
Дата
Msg-id 2521.1284054522@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session  (Magnus Hagander <magnus@hagander.net>)
Список 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 по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session
Следующее
От: Tom Lane
Дата:
Сообщение: Re: returning multiple result sets from a stored procedure