Support for connect_timeout in PQconnectdb()
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 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. Thanks, Kyle -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVktkHAAoJEBZxgM7w3gB17ckIANbugIy+HW/jH4wo6lLkKigf xRW0nUXZ05P3+E4N3B8GWnpVokK5tAIiX7LhYBTTlrLzpKbOAQRr1EMfEzvQW4Ij kj5QFGtnZ/18dnz8MAYWYrOnkvzg6ym53ks4rNOEhUhpsp6B6P23lwCp24jT7MYV MGmbuJieQV9Dz8MePEbRzeDrfCt8qE3DLKotOjSjgf62+H1jL1fQlpjF96QO/6nF AV4BVLXba/AsQNbCh6fWlKljtTEPnjfI1RzBgzlvVoC3AX8BVu0dCuMYI7Rw8rSe ZPne+iQ80/ycM6zU6ux86kKsTfmeQvgZM+TIS5aCZLsoxibZEvgJciswBhT3kkU= =xp7I -----END PGP SIGNATURE-----
On Jun 30, 2015, at 1:59 PM, Kyle Birkeland <kbirkela@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-avail... The contents of that config item gets passed to PQconnectdb, so you can set whatever options you need there. -Arran
Ah, well that's much simpler. Thanks Arran! From: Arran Cudbard-Bell <a.cudbardb@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@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-avail... The contents of that config item gets passed to PQconnectdb, so you can set whatever options you need there. -Arran
On 30 Jun 2015, at 14:10, Birkeland, Kyle Armand <kbirkela@utk.edu> wrote:
Ah, well that's much simpler. Thanks Arran!
Yeah, too bad the postgres guys didn't include provide a proper interface to set the options programatically :( We have options for connect timeout and query timeout in the SQL module config, but it set them we need to do stupid hacky string manipulation. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (3)
-
Arran Cudbard-Bell -
Birkeland, Kyle Armand -
Kyle Birkeland