Re: Proposal to add connection request Wait-time in PSQL client. - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Proposal to add connection request Wait-time in PSQL client.
Date
Msg-id 5198431D.1090002@2ndquadrant.com
Whole thread Raw
In response to Proposal to add connection request Wait-time in PSQL client.  (amul sul <sul_amul@yahoo.co.in>)
Responses Re: Proposal to add connection request Wait-time in PSQL client.  (amul sul <sul_amul@yahoo.co.in>)
List 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




pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: request a new feature in fuzzystrmatch
Next
From: amul sul
Date:
Subject: Re: Proposal to add connection request Wait-time in PSQL client.