Thread: Service control enhancements

Service control enhancements

From
"Dave Page"
Date:
The attached patch improves pg_ctl's win32 service code to eliminate
some possible causes of the stale postmaster.pid problem that some users
have reported.

- The service did not properly report that it accepts
SERVICE_CONTROL_SHUTDOWN events, thus it's possible the SCM simply
killed the postmaster on shutdown.

- 'WaitHints' are now given to the SCM to prevent it timing out if
pg_ctl doesn't respond to a control event quickly enough.

- During shutdown, the service checkpoint counter is incremented every
five seconds for up to a minute to prevent the SCM timing out and
assuming the service is not responding.

Please apply.

Regards, Dave.

Attachment

Re: Service control enhancements

From
Bruce Momjian
Date:
Patch applied.  Thanks.

---------------------------------------------------------------------------


Dave Page wrote:
> The attached patch improves pg_ctl's win32 service code to eliminate
> some possible causes of the stale postmaster.pid problem that some users
> have reported.
>
> - The service did not properly report that it accepts
> SERVICE_CONTROL_SHUTDOWN events, thus it's possible the SCM simply
> killed the postmaster on shutdown.
>
> - 'WaitHints' are now given to the SCM to prevent it timing out if
> pg_ctl doesn't respond to a control event quickly enough.
>
> - During shutdown, the service checkpoint counter is incremented every
> five seconds for up to a minute to prevent the SCM timing out and
> assuming the service is not responding.
>
> Please apply.
>
> Regards, Dave.

Content-Description: pg_ctl.c.diff

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073