Обсуждение: pgAgent: Log connection error message and initial connection

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

pgAgent: Log connection error message and initial connection

От
Ashesh Vashi
Дата:
Hi All,

As per my discussion with Dave Page, I have modified pgagent:

- Log connection error message no matter what the log level is.
  Introduced a LOG_WARN_EXT (EXTENDED WARNING), which will log
  messages as warning even without taking the LogLevel into
  consideration

- If the initial connection attempt fails, it will loop, and
  retry a few times at the speed of the normal
timing loop
  before giving up.

Please find the patch for that.

--
Regards,
Ashesh Vashi

EnterpriseDB INDIA: http://www.enterprisedb.com

Re: pgAgent: Log connection error message and initial connection

От
Dave Page
Дата:
On Thu, Feb 5, 2009 at 1:02 PM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Hi All,
>
> As per my discussion with Dave Page, I have modified pgagent:
>
> - Log connection error message no matter what the log level is.
>   Introduced a LOG_WARN_EXT (EXTENDED WARNING), which will log
>   messages as warning even without taking the LogLevel into
>   consideration

OK.

> - If the initial connection attempt fails, it will loop, and
>   retry a few times at the speed of the normal timing loop
>   before giving up.

Hmm, I don't see any of the service code I expected to see for
Windows. At the moment when the service starts we start MainLoop() and
immediately tell the SCM that the service state is 'running'. What we
should do, is tell the SCM that the service is starting until the
primary connection is successful, and only then tell the SCM that
we're running. That way, the service will refuse to start if the
connection cannot be made, rather than starting and then stopping
again. It'll also mean that when starting the service manually, the
progress bar will be shown until the connection is established and we
know everything is good.

That's the code I mentioned I'd worked on in pg_ctl - in particular
look at the do_checkpoint related stuff in
test_postmaster_connection() which is how we tell the SCM that we're
still trying to startup.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: pgAgent: Log connection error message and initial connection

От
Ashesh Vashi
Дата:
Hi Dave,
- If the initial connection attempt fails, it will loop, and retry a few times at the speed of the normal timing loop before giving up.

Hmm, I don't see any of the service code I expected to see for
Windows. At the moment when the service starts we start MainLoop() and
immediately tell the SCM that the service state is 'running'. What we
should do, is tell the SCM that the service is starting until the
primary connection is successful, and only then tell the SCM that
we're running. That way, the service will refuse to start if the
connection cannot be made, rather than starting and then stopping
again. It'll also mean that when starting the service manually, the
progress bar will be shown until the connection is established and we
know everything is good.

That's the code I mentioned I'd worked on in pg_ctl - in particular
look at the do_checkpoint related stuff in
test_postmaster_connection() which is how we tell the SCM that we're
still trying to startup.
Please find the updated patch for that.
--
Regards,
Ashesh Vashi

EnterpriseDB INDIA: http://www.enterprisedb.com

Re: pgAgent: Log connection error message and initial connection

От
Dave Page
Дата:
On Fri, Feb 6, 2009 at 2:33 PM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Hi Dave,
>
> - If the initial connection attempt fails, it will loop, and
>   retry a few times at the speed of the normal timing loop
>   before giving up.
>
> Hmm, I don't see any of the service code I expected to see for
> Windows. At the moment when the service starts we start MainLoop() and
> immediately tell the SCM that the service state is 'running'. What we
> should do, is tell the SCM that the service is starting until the
> primary connection is successful, and only then tell the SCM that
> we're running. That way, the service will refuse to start if the
> connection cannot be made, rather than starting and then stopping
> again. It'll also mean that when starting the service manually, the
> progress bar will be shown until the connection is established and we
> know everything is good.
>
> That's the code I mentioned I'd worked on in pg_ctl - in particular
> look at the do_checkpoint related stuff in
> test_postmaster_connection() which is how we tell the SCM that we're
> still trying to startup.
>
> Please find the updated patch for that.

Thanks - patch applied with some minor cosmetic tweaking, and removal
of the START_SUSPENDED stuff that we never used anyway.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com