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.
pull/4901/head
Rene Cannao 3 months ago
parent dc4694d656
commit fbf5f2d762

@ -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<unsigned long long>(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);

Loading…
Cancel
Save