From fbf5f2d76249be36b04ff7aaab2af4b4e31bb6b8 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sat, 6 Dec 2025 14:56:12 +0000 Subject: [PATCH] Improve wait_timeout warning messages with detailed connection information Enhance logging clarity: - Replace generic IP address with detailed connection info including IP and port - Use client_myds->addr.addr and client_myds->addr.port for precise identification - Improve debuggability of timeout clamping and enforcement warnings The warning messages now provide complete connection details, making it easier to identify and troubleshoot timeout-related issues in ProxySQL logs. --- lib/MySQL_Session.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index ab17a8e4d..729f041ff 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -6627,8 +6627,8 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C // Warn if value was clamped due to ProxySQL limits if (original_timeout != client_timeout) { - proxy_warning("Client [%s] (user: %s) requested wait_timeout = %llu ms, clamped to %llu ms (ProxySQL limits: 1s to 20 days)\n", - client_myds->myconn->connected_host_details.ip, + proxy_warning("Client [%s:%d] (user: %s) requested wait_timeout = %llu ms, clamped to %llu ms (ProxySQL limits: 1s to 20 days)\n", + client_myds->addr.addr, client_myds->addr.port, client_myds->myconn->userinfo->username, original_timeout, client_timeout); @@ -6636,8 +6636,8 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C // Warn if client's value exceeds current global timeout (after clamping) if (client_timeout > static_cast(mysql_thread___wait_timeout)) { - proxy_warning("Client [%s] (user: %s) requested wait_timeout = %llu ms, exceeds the global mysql-wait_timeout = %d ms. Global timeout will still be enforced.\n", - client_myds->myconn->connected_host_details.ip, + proxy_warning("Client [%s:%d] (user: %s) requested wait_timeout = %llu ms, exceeds the global mysql-wait_timeout = %d ms. Global timeout will still be enforced.\n", + client_myds->addr.addr, client_myds->addr.port, client_myds->myconn->userinfo->username, client_timeout, mysql_thread___wait_timeout);