From b4b6bad1b0cdac9d6dea89882fe3798b09db8474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Fri, 3 Aug 2018 19:47:18 +0200 Subject: [PATCH] Set DSS state when running query This prevent proxysql from hanging when sending query to server is slow --- lib/mysql_connection.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/mysql_connection.cpp b/lib/mysql_connection.cpp index 777a9b7bb..c259a57e0 100644 --- a/lib/mysql_connection.cpp +++ b/lib/mysql_connection.cpp @@ -1261,6 +1261,11 @@ int MySQL_Connection::async_query(short event, char *stmt, unsigned long length, ) { return -1; } + if (myds) { + if (myds->DSS != STATE_MARIADB_QUERY) { + myds->DSS = STATE_MARIADB_QUERY; + } + } switch (async_state_machine) { case ASYNC_QUERY_END: processing_multi_statement=false; // no matter if we are processing a multi statement or not, we reached the end