Re: Should we make scary sounding, but actually routine, errors less scary?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Should we make scary sounding, but actually routine, errors less scary?
Date: 2019-11-07 23:46:13
Message-ID: 20191107234613.rivjvk5bbfteq4xy@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-11-08 00:00:11 Re: Should we make scary sounding, but actually routine, errors less scary?
Previous Message Thomas Munro 2019-11-07 23:44:13 Collation versions on Windows (help wanted, apply within)