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

From amul sul
Subject Re: Proposal to add connection request Wait-time in PSQL client.
Date
Msg-id 1368934899.65669.YahooMailNeo@web193502.mail.sg3.yahoo.com
Whole thread Raw
In response to Re: Proposal to add connection request Wait-time in PSQL client.  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Proposal to add connection request Wait-time in PSQL client.  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers

> It isn't clear to me why this needs to be tackled in psql or the other
> clients.

This case only for the client PSQL, who has running transaction,yet not has been finished 
and suddenly some other backend crashed or killed, then server restarted in recovery mode.

Then this client immediately send request to connection reset, But it might fail because of server is 
not startup properly to accept connection from recovery mode.
So, idea behind this, before throwing connection fail error, client should wait keep trying for connection reset, in
boundedwait time. 

> 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.

Yes, you are correct. even in those script need to add time interval to resend  request again and again.
 Instead of this, can we add loop in Client code, so it can keep trying to connection request?
 in a way, we client terminal wont hangup by throwing  *The connection to the server was lost. Attempting reset:
Failed. !*

Regards,
Amul Sul



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Proposal to add connection request Wait-time in PSQL client.
Next
From: Craig Ringer
Date:
Subject: Re: Proposal to add connection request Wait-time in PSQL client.