Patch to use query_timeout in rlm_sql_mysql

Brian De Wolf bldewolf at
Thu Jan 12 03:07:39 CET 2012


When I was setting up freeradius to use our existing multi-master MySQL
setup, I noticed that freeradius would hang seemingly forever if one of
the MySQL servers failed to respond (or wasn't responding during

The rlm_sql module has a query_timeout option but it wasn't being used
in the mysql driver.  The attached patch adds the appropriate lines to
set mysql library options to use timeouts based on query_timeout for
connecting, reads, and writes.

The only confusing caveat is that the read and write timeouts
apparently have retries built-in, so the timeout is effectively 3 times
the query_timeout time.

Also, the connect timeout would ideally be a different variable, but I
didn't see an existing variable for such a purpose and felt it
simplified the patch if I didn't add one.

Other than this problem, freeradius has been great.  Thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeradius-2.1.12-query-timeouts.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <>

More information about the Freeradius-Devel mailing list