Re: Should we make scary sounding, but actually routine, errors lessscary? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Should we make scary sounding, but actually routine, errors lessscary?
Date
Msg-id 20191107234613.rivjvk5bbfteq4xy@alap3.anarazel.de
Whole thread Raw
In response to Re: Should we make scary sounding, but actually routine, errors lessscary?  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
Hi,

On 2019-11-05 22:00:58 -0500, Chapman Flack wrote:
> On 11/05/19 18:54, Andres Freund wrote:
> > Hi,
> > 
> > There's a few errors that we issue that are, often, much less bad than
> > they sound. The most common cases I immediately can recall are:
> > 
> > 
> > 1) Mentioning crash, once for each backend, when shutting down
> > immediately. Currently the log output for that, with just two sessions
> > connected, is the following:
> 
> While on the topic ... this may be more a property of particular
> packagings of the server, to run under systemd etc., but often there
> is a process during startup trying periodically to open a connection
> to the server to confirm that it has successfully started, and the
> result is a dozen or so log messages that say "FATAL: the server is
> starting" ... which is amusing once you get what it's doing, but a bit
> disconcerting until then.

I think that is best solved by using pg_ctl's logic to look at the
postmaster state file, rather than connecting before the server is
ready. For one connecting requires to actually be able to connect, which
isn't always a given.  If using pg_ctl is problematic for some reason,
it'd imo be better to extract the relevant logic into its own tool.


> Not sure how that could be changed ... maybe a connection-time option
> trial_connection that would suppress the fatal ereport on rejecting
> the connection?

I think that'd be a recipe for hard to debug issues. Imagine somebody
DOSing the server and setting that option - you'd have no way to
actually see what's happening.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Collation versions on Windows (help wanted, apply within)
Next
From: Andres Freund
Date:
Subject: Re: Should we make scary sounding, but actually routine, errors lessscary?