Re: Postgres service stops when I kill client backend on Windows

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Postgres service stops when I kill client backend on Windows
Дата
Msg-id CAB7nPqREgeXhxPT-S8DMon0hwFG6Du2r47aBfqFc4cS2Wve8XQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Postgres service stops when I kill client backend on Windows  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: Postgres service stops when I kill client backend on Windows
Список pgsql-hackers
On Mon, Oct 12, 2015 at 7:26 PM, Magnus Hagander <magnus@hagander.net> wrote:
>
>
> On Mon, Oct 12, 2015 at 12:25 PM, Andres Freund <andres@anarazel.de> wrote:
>>
>> On 2015-10-12 11:25:35 +0530, Amit Kapila wrote:
>> >       /*
>> > +      * Close the shared memory handle as the syslogger doesn't need to
>> > +      * attach to it.  For EXEC_BACKEND case, the shared memory handle
>> > +      * is inherited by all postmaster child processes irrespective of
>> > +      * whether they need it or not.
>> > +      */
>> > +#ifdef EXEC_BACKEND
>> > +     if (!CloseHandle(UsedShmemSegID))
>> > +             elog(LOG, "could not close handle to shared memory: error
>> > code %lu", GetLastError());
>> > +#endif
>> > +
>>
>> It feels wrong to do this in syslogger.c - I mean it's not the only
>> process that's not attached to shared memory. Sure, the others get
>> killed, but nonetheless...
>
>
> +1. It feels like we're setting our selves up for repeating this mistake at
> some later time :)

Actually, doesn't this apply as well to the archiver and the pgstat
collector? So perhaps we may want to do that in SubPostmasterMain with
PGSharedMemoryDetach. See for example the attached as an idea (patch
completely untested).
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: WIP: Rework access method interface
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Postgres service stops when I kill client backend on Windows