]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't use MySQL read / write timeout options
authorNick Porter <nick@portercomputing.co.uk>
Thu, 20 Jun 2024 09:00:36 +0000 (10:00 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 20 Jun 2024 09:00:36 +0000 (10:00 +0100)
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.

raddb/mods-available/sql
src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c

index e8b158ccdaa5cc5d14d9f04a36225b593d0ce51a..876930b66d683e6781d35038805171092495b2ea 100644 (file)
@@ -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
 
index 55726165ca24009bf29d171a974b01b4b8ca884f..cf33852971057651c22a54ac454489654b7b420b 100644 (file)
@@ -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