Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpGYK-0006GH-Ee for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Sep 2016 15:13:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bpGYK-0004vA-1O for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Sep 2016 15:13:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bpGYI-0004uJ-Ni for pgsql-hackers@postgresql.org; Wed, 28 Sep 2016 15:13:42 +0000 Received: from linode.thelabyrinth.net ([198.58.117.137] helo=mail.thelabyrinth.net) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bpGYF-0004AQ-RJ for pgsql-hackers@postgresql.org; Wed, 28 Sep 2016 15:13:42 +0000 Received: from Davids-iMac.local (unknown [98.204.177.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 52B9512D7B; Wed, 28 Sep 2016 15:13:37 +0000 (UTC) Subject: Re: psql casts aspersions on server reliability To: Robert Haas , Tom Lane References: <15946.1475068481@sss.pgh.pa.us> Cc: "pgsql-hackers@postgresql.org" From: David Steele Message-ID: <369be187-8843-32da-17d6-cb64ad2c2154@pgmasters.net> Date: Wed, 28 Sep 2016 11:13:36 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 9/28/16 10:22 AM, Robert Haas wrote: > On Wed, Sep 28, 2016 at 9:14 AM, Tom Lane wrote: >> Robert Haas writes: >>> psql tends to do things like this: >>> rhaas=# select * from pg_stat_activity; >>> FATAL: terminating connection due to administrator command >>> server closed the connection unexpectedly >>> This probably means the server terminated abnormally >>> before or while processing the request. >> >>> Basically everything psql has to say about this is a lie: >> >> I cannot get terribly excited about this. What you seem to be proposing >> is that psql try to intuit the reason for connection closure from the >> last error message it got, but that seems likely to lead to worse lies >> than printing a boilerplate message. >> >> I could go along with just dropping the last sentence ("This probably...") >> if the last error we got was FATAL level. I don't find "unexpectedly" >> to be problematic here: from the point of view of psql, and probably >> of its user, the shutdown *was* unexpected. > > I don't care very much whether we try to intuit the reason for > connection closure or not; it could be done, but I don't feel that it > has to be done. My bigger point is that currently psql speculates > that the reason for *every* connection closure is abnormal server > termination, which is actually a very rare event. > > It may have been common when that message was added. > 1a17447be1186fdd36391c58a2a0209f613d89c4 changed the wording this > message in 2001, and the original message seems to date to > 011ee13131f6fa2f6dbafd3827b70d051cb28f64 in 1996. And my guess is at > that time the server probably did just roll over and die with some > regularity. But today it usually doesn't. It's neither helpful nor > good PR for libpq to guess that the most likely cause of a server > disconnection is server unreliability. > > I have seen actual instances of customers getting upset by this > message even though the server had been shut down quite cleanly. The > message got into a logfile and induced minor panic. Fortunately, I > have not seen this happen lately. +1 for making this error message less frightening. I have also had to explain it away on occasion. -- -David david@pgmasters.net -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers