From: Nick Porter Date: Thu, 20 Jun 2024 09:00:36 +0000 (+0100) Subject: Don't use MySQL read / write timeout options X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=104dfa2c5fc7b95dee3b758ec8c654dbfe16cc6a;p=thirdparty%2Ffreeradius-server.git Don't use MySQL read / write timeout options The model for async is different to the sync client. Timeouts are expected to be handled by the calling application rather than the client library. --- diff --git a/raddb/mods-available/sql b/raddb/mods-available/sql index e8b158ccdaa..876930b66d6 100644 --- a/raddb/mods-available/sql +++ b/raddb/mods-available/sql @@ -194,7 +194,7 @@ sql { # logfile = ${logdir}/sqllog.sql # - # query_timeout:: Set the maximum query duration for `mysql` and `cassandra`. + # query_timeout:: Set the maximum query duration for `cassandra`. # # query_timeout = 5 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c b/src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c index 55726165ca2..cf338529710 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c +++ b/src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c @@ -290,32 +290,6 @@ static connection_state_t _sql_connection_init(void **h, connection_t *conn, voi mysql_options(&(c->db), MYSQL_OPT_RECONNECT, &reconnect); } - if (fr_time_delta_ispos(config->query_timeout)) { - unsigned int read_timeout = fr_time_delta_to_sec(config->query_timeout); - unsigned int write_timeout = fr_time_delta_to_sec(config->query_timeout); - - /* - * The timeout in seconds for each attempt to read from the server. - * There are retries if necessary, so the total effective timeout - * value is three times the option value. - */ - if (read_timeout >= 3) read_timeout /= 3; - - /* - * The timeout in seconds for each attempt to write to the server. - * There is a retry if necessary, so the total effective timeout - * value is two times the option value. - */ - if (write_timeout >= 2) write_timeout /= 2; - - /* - * Connect timeout is actually connect timeout (according to the - * docs) there are no automatic retries. - */ - mysql_options(&(c->db), MYSQL_OPT_READ_TIMEOUT, &read_timeout); - mysql_options(&(c->db), MYSQL_OPT_WRITE_TIMEOUT, &write_timeout); - } - sql_flags = CLIENT_MULTI_RESULTS | CLIENT_FOUND_ROWS; #ifdef CLIENT_MULTI_STATEMENTS