Re: [PATCH] Allow breaking out of hung connection attempts - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: [PATCH] Allow breaking out of hung connection attempts
Date
Msg-id 4FFED109.7030203@enterprisedb.com
Whole thread Raw
In response to Re: [PATCH] Allow breaking out of hung connection attempts  (Shigeru HANADA <shigeru.hanada@gmail.com>)
List pgsql-hackers
On 09.07.2012 11:35, Shigeru HANADA wrote:
> Once the issues above are fixed, IMO this patch can be marked as "Ready
> for committer".

Thanks. The docs on async connections says:

"The connect_timeout connection parameter is ignored when using 
PQconnectPoll; it is the application's responsibility to decide whether 
an excessive amount of time has elapsed."

I think we should recommend using PQconnectTimeout(), similar to what 
you did in psql, in all client applications that use the non-blocking 
connection API. Perhaps something like:

"The connect_timeout connection parameter is ignored when using 
PQconnectPoll; it is the application's responsibility to decide whether 
an excessive amount of time has elapsed. It is recommended to use the 
PQconnectTimeout() to get value of the parameter, and use that as the 
timeout in the application. That way the user gets the same timeout 
behavior, regardless of whether the application uses PQconnectPoll or 
the nonblocking connection API."

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Schema version management
Next
From: Joel Jacobson
Date:
Subject: Re: Schema version management