freeradius-server icon indicating copy to clipboard operation
freeradius-server copied to clipboard

[defect]: unhandled MySQL timeout

Open majagw opened this issue 1 year ago • 0 comments

What type of defect/bug is this?

Unexpected behaviour (obvious or verified by project member)

How can the issue be reproduced?

On FR 3.2.6 and mysqld 8.0.39 (Ubuntu 24.04) I observe ERROR: rlm_sql_mysql: ERROR 4031 (The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.)

it happens when MySQL wait_timeout and interactive_timeout is over

While digging for the reason I stumbled upon the information that there is a new return code in MySQL 8 for connection timeout, it is ER_CLIENT_INTERACTION_TIMEOUT. This code isn't handled in FR yet.

I've added it to src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c in sql_check_error and it seems to cure the problem

@@ -385,6 +385,7 @@ if (sql_errno > 0) switch (sql_errno) { case CR_SERVER_GONE_ERROR: case CR_SERVER_LOST:

  • case ER_CLIENT_INTERACTION_TIMEOUT: case -1: return RLM_SQL_RECONNECT;

Log output from the FreeRADIUS daemon

ERROR: rlm_sql_mysql: ERROR 4031 (The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.)

Relevant log output from client utilities

No response

Backtrace from LLDB or GDB

No response

majagw avatar Sep 04 '24 08:09 majagw