Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Mark Llewellyn <mark_llewellyn(at)adp(dot)com>, pgsql-hackers(at)postgresql(dot)org, Sujeet Rajguru <sujeet(dot)rajguru(at)enterprisedb(dot)com>
Subject: Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Date: 2010-11-17 18:50:22
Message-ID: 201011171850.oAHIoM018166@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Magnus Hagander wrote:
> > I basically report the connection error string if it starts with "FATAL:".
> >
> > I originally tried to check for an ERRCODE_INVALID_PASSWORD error field
> > (see // comments), but it seems there is no way to access this, i.e.
> > PQgetResult(conn) on a connection failure is always NULL.
> >
> > Anyway, perhaps FATAL is a better test because it will report any major
> > failure, not just a .pgpass one.
> >
> > Patch attached.
>
> Bad Bruce, using C++ comments like that :P And non-context diff ;)

That comment use was to highlight that those are not for commit, but
there if people want to test.

As far as the diff, it seems git-external-diff isn't portable to
non-Linux systems; I will post a separate email on that.

> Does this actually solve the *problem*, though? The problem is not
> what is reported on stdout/stderr, the problem is that the net result
> is that the server is reported as not started (by the service control
> manager) when it actually *is* started. In this case, stderr doesn't
> even go anywhere. What happens if you *don't* Ctrl-C it?

I was just going to post on that. :-) Right now, it prints the FATAL
and keeps printing 60 times, then says not running. Should we just exit
on FATAL and output a special exit string, or say running?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2010-11-17 18:52:19 Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Previous Message Heikki Linnakangas 2010-11-17 18:37:42 Re: BUG #5755: Query Optimzer Bug

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-11-17 18:52:19 Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Previous Message Robert Haas 2010-11-17 18:48:56 Re: unlogged tables