Support for connect_timeout in PQconnectdb()

Arran Cudbard-Bell a.cudbardb at freeradius.org
Tue Jun 30 20:09:08 CEST 2015


> On Jun 30, 2015, at 1:59 PM, Kyle Birkeland <kbirkela at utk.edu> wrote:
> 
> Signed PGP part
> Hello,
> 
> I'm trying to use a postgresql database in a redundant block on v3.0.8
> like so:
> 
> 
>   redundant {
>      pgsql
>      detail
>      ok
>   }
> 
> 
> Unfortunately, whenever a request hits this part of the config, it hangs
> for over 120 seconds waiting for the connection to set up before moving
> down the redundant block.
> 
> PQconnectdb() does have a connect_timeout option to configure how long
> the function will wait before returning an error, but I don't see a way
> to configure this in FR.  mod_instantiate() in rlm_sql_postgresql.c looks
> like it only supports the dbname, host, port, user, password, and
> application_name.
> 
> Would it be possible to get a patch that will add a connect_timeout
> option to the rlm_sql_postgresql config?  It would be greatly appreciated.
> 
> 

https://github.com/FreeRADIUS/freeradius-server/blob/v3.1.x/raddb/mods-available/sql#L62

The contents of that config item gets passed to PQconnectdb, so you can set whatever options
you need there.

-Arran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20150630/58035806/attachment.sig>


More information about the Freeradius-Users mailing list