Re: Proposal to add connection request Wait-time in PSQL client.

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: amul sul <sul_amul(at)yahoo(dot)co(dot)in>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal to add connection request Wait-time in PSQL client.
Date: 2013-05-19 03:12:29
Message-ID: 5198431D.1090002@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05/17/2013 08:22 AM, amul sul wrote:
> Hello,
>
> I have observed the following same situation in PG 9.3beta1
> Multiple PSQL clients are connected to server, some of them running transaction and some of them are idle state.
>
>
> When one of the backend is killed or crashed (using kill -9 <backend-pid>).
> The connection reset attempt from the active clients( that is, which were running a transaction and crashed in between) fails, since they immediately make the attempt while the server is in startup phase.
It isn't clear to me why this needs to be tackled in psql or the other
clients.

Usually one has retry and back-off code in whatever's using the client -
shell script using psql, Python program with psycopg2, Java program with
PgJDBC, etc - that manages reconnection and retries.

If server restarts were routine it might more sense to teach the client
code about this - but they should not be. Your first problem is "killed
using kill -9". You should not need to do that, nor should you be
experiencing backed crashes. If you are, investigate the underlying
cause and fix that.

I'm not a big fan of the idea of psql having its own internal retry loop.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message amul sul 2013-05-19 03:41:39 Re: Proposal to add connection request Wait-time in PSQL client.
Previous Message David Fetter 2013-05-19 01:38:40 Re: request a new feature in fuzzystrmatch