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



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to