Support for connect_timeout in PQconnectdb()

Birkeland, Kyle Armand kbirkela at utk.edu
Tue Jun 30 20:10:28 CEST 2015


Ah, well that's much simpler.  Thanks Arran!

From: Arran Cudbard-Bell <a.cudbardb at freeradius.org>
Sent: Jun 30, 2015 2:08 PM
To: FreeRadius users mailing list
Subject: Re: Support for connect_timeout in PQconnectdb()


> 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


More information about the Freeradius-Users mailing list