Re: [BUGS] BUG #11805: Missing SetServiceStatus call during service shutdown in pg_ctl (Windows only)

Поиск
Список
Период
Сортировка
Искать

Re: [BUGS] BUG #11805: Missing SetServiceStatus call during service shutdown in pg_ctl (Windows only)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
On Tue, Oct 28, 2014 at 07:02:41AM +0000, krystian.bigaj@gmail.com wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      11805
> Logged by:          Krystian Bigaj
> Email address:      krystian.bigaj@gmail.com
> PostgreSQL version: 9.3.5
> Operating system:   Windows 7 Pro x64
> Description:        
> 
> pg_ctl on Windows during service start/shutdown should notify service
> manager about it's status by increment dwCheckPoint and call to
> SetServiceStatus/pgwin32_SetServiceStatus.
> 
> However during shutdown there is a missing call to SetServiceStatus.
> See src\bin\pg_ctl\pg_ctl.c:

[ thread moved to hackers ]

Can a Windows person look into this issue?
      http://www.postgresql.org/message-id/20141028070241.2593.58180@wrigleys.postgresql.org

The thread includes a patch.  I need a second person to verify its
validity.  Thanks.

--  Bruce Momjian          http://momjian.us EnterpriseDB                             http://enterprisedb.com
 + Everyone has their own god. +


Re: Re: [BUGS] BUG #11805: Missing SetServiceStatus call during service shutdown in pg_ctl (Windows only)

От:
Michael Paquier <michael.paquier@gmail.com>
Дата:
On Fri, Mar 20, 2015 at 9:48 PM, Bruce Momjian  wrote:
> On Tue, Oct 28, 2014 at 07:02:41AM +0000, krystian.bigaj@gmail.com wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference:      11805
>> Logged by:          Krystian Bigaj
>> Email address:      krystian.bigaj@gmail.com
>> PostgreSQL version: 9.3.5
>> Operating system:   Windows 7 Pro x64
>> Description:
>>
>> pg_ctl on Windows during service start/shutdown should notify service
>> manager about it's status by increment dwCheckPoint and call to
>> SetServiceStatus/pgwin32_SetServiceStatus.
>>
>> However during shutdown there is a missing call to SetServiceStatus.
>> See src\bin\pg_ctl\pg_ctl.c:
>
> [ thread moved to hackers ]
>
> Can a Windows person look into this issue?
>
>        http://www.postgresql.org/message-id/20141028070241.2593.58180@wrigleys.postgresql.org
>
> The thread includes a patch.  I need a second person to verify its
> validity.  Thanks.

FWIW, it looks sane to me to do so, ServiceMain declaration is in
charge to start the service, and to wait for the postmaster to stop,
and indeed process may increment dwcheckpoint in -w mode, and it
expects for process to wait for 12 times but this promise is broken.
The extra calls to SetServiceStatus are also welcome to let the SCM
know the current status in more details.

A back-patch would be good as well...
Regards,
-- 
Michael


Re: Re: [BUGS] BUG #11805: Missing SetServiceStatus call during service shutdown in pg_ctl (Windows only)

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Sat, Mar 21, 2015 at 9:00 AM, Michael Paquier
 wrote:
> On Fri, Mar 20, 2015 at 9:48 PM, Bruce Momjian  wrote:
>> On Tue, Oct 28, 2014 at 07:02:41AM +0000, krystian.bigaj@gmail.com wrote:
>>> The following bug has been logged on the website:
>>>
>>> Bug reference:      11805
>>> Logged by:          Krystian Bigaj
>>> Email address:      krystian.bigaj@gmail.com
>>> PostgreSQL version: 9.3.5
>>> Operating system:   Windows 7 Pro x64
>>> Description:
>>>
>>> pg_ctl on Windows during service start/shutdown should notify service
>>> manager about it's status by increment dwCheckPoint and call to
>>> SetServiceStatus/pgwin32_SetServiceStatus.
>>>
>>> However during shutdown there is a missing call to SetServiceStatus.
>>> See src\bin\pg_ctl\pg_ctl.c:
>>
>> [ thread moved to hackers ]
>>
>> Can a Windows person look into this issue?
>>
>>        http://www.postgresql.org/message-id/20141028070241.2593.58180@wrigleys.postgresql.org
>>
>> The thread includes a patch.  I need a second person to verify its
>> validity.  Thanks.
>
> FWIW, it looks sane to me to do so, ServiceMain declaration is in
> charge to start the service, and to wait for the postmaster to stop,
> and indeed process may increment dwcheckpoint in -w mode, and it
> expects for process to wait for 12 times but this promise is broken.
> The extra calls to SetServiceStatus are also welcome to let the SCM
> know the current status in more details.

So, what's next here?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Re: [BUGS] BUG #11805: Missing SetServiceStatus call during service shutdown in pg_ctl (Windows only)

От:
Michael Paquier <michael.paquier@gmail.com>
Дата:
On Thu, Apr 30, 2015 at 9:53 PM, Robert Haas  wrote:
> On Sat, Mar 21, 2015 at 9:00 AM, Michael Paquier
>  wrote:
>> On Fri, Mar 20, 2015 at 9:48 PM, Bruce Momjian  wrote:
>>> On Tue, Oct 28, 2014 at 07:02:41AM +0000, krystian.bigaj@gmail.com wrote:
>>>> The following bug has been logged on the website:
>>>>
>>>> Bug reference:      11805
>>>> Logged by:          Krystian Bigaj
>>>> Email address:      krystian.bigaj@gmail.com
>>>> PostgreSQL version: 9.3.5
>>>> Operating system:   Windows 7 Pro x64
>>>> Description:
>>>>
>>>> pg_ctl on Windows during service start/shutdown should notify service
>>>> manager about it's status by increment dwCheckPoint and call to
>>>> SetServiceStatus/pgwin32_SetServiceStatus.
>>>>
>>>> However during shutdown there is a missing call to SetServiceStatus.
>>>> See src\bin\pg_ctl\pg_ctl.c:
>>>
>>> [ thread moved to hackers ]
>>>
>>> Can a Windows person look into this issue?
>>>
>>>        http://www.postgresql.org/message-id/20141028070241.2593.58180@wrigleys.postgresql.org
>>>
>>> The thread includes a patch.  I need a second person to verify its
>>> validity.  Thanks.
>>
>> FWIW, it looks sane to me to do so, ServiceMain declaration is in
>> charge to start the service, and to wait for the postmaster to stop,
>> and indeed process may increment dwcheckpoint in -w mode, and it
>> expects for process to wait for 12 times but this promise is broken.
>> The extra calls to SetServiceStatus are also welcome to let the SCM
>> know the current status in more details.
>
> So, what's next here?

I guess that a committer opinion would be welcome. IMO the current
behavior is a bug.
-- 
Michael


Re: Re: [BUGS] BUG #11805: Missing SetServiceStatus call during service shutdown in pg_ctl (Windows only)

От:
Magnus Hagander <magnus@hagander.net>
Дата:
On Thu, Apr 30, 2015 at 3:08 PM, Michael Paquier <michael.paquier@gmail.com> wrote:
On Thu, Apr 30, 2015 at 9:53 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Sat, Mar 21, 2015 at 9:00 AM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
>> On Fri, Mar 20, 2015 at 9:48 PM, Bruce Momjian <bruce@momjian.us> wrote:
>>> On Tue, Oct 28, 2014 at 07:02:41AM +0000, krystian.bigaj@gmail.com wrote:
>>>> The following bug has been logged on the website:
>>>>
>>>> Bug reference:      11805
>>>> Logged by:          Krystian Bigaj
>>>> Email address:      krystian.bigaj@gmail.com
>>>> PostgreSQL version: 9.3.5
>>>> Operating system:   Windows 7 Pro x64
>>>> Description:
>>>>
>>>> pg_ctl on Windows during service start/shutdown should notify service
>>>> manager about it's status by increment dwCheckPoint and call to
>>>> SetServiceStatus/pgwin32_SetServiceStatus.
>>>>
>>>> However during shutdown there is a missing call to SetServiceStatus.
>>>> See src\bin\pg_ctl\pg_ctl.c:
>>>
>>> [ thread moved to hackers ]
>>>
>>> Can a Windows person look into this issue?
>>>
>>>        http://www.postgresql.org/message-id/20141028070241.2593.58180@wrigleys.postgresql.org
>>>
>>> The thread includes a patch.  I need a second person to verify its
>>> validity.  Thanks.
>>
>> FWIW, it looks sane to me to do so, ServiceMain declaration is in
>> charge to start the service, and to wait for the postmaster to stop,
>> and indeed process may increment dwcheckpoint in -w mode, and it
>> expects for process to wait for 12 times but this promise is broken.
>> The extra calls to SetServiceStatus are also welcome to let the SCM
>> know the current status in more details.
>
> So, what's next here?

I guess that a committer opinion would be welcome. IMO the current
behavior is a bug.

Agreed, it pretty clearly is.

I've applied this patch (with a minor stylistic change), and backpatched. 

--
FAQ