Patch to use query_timeout in rlm_sql_mysql
Greetings, 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 startup). 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! Brian
Brian De Wolf wrote:
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.
I've added it, with a fix for the 3x retry. Alan DeKok.
participants (2)
-
Alan DeKok -
Brian De Wolf