diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs827_write_timeout b/maxscale-system-test/cnf/maxscale.cnf.template.mxs827_write_timeout index 2f9094b66..dd458fda4 100755 --- a/maxscale-system-test/cnf/maxscale.cnf.template.mxs827_write_timeout +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs827_write_timeout @@ -18,7 +18,7 @@ user=maxskysql password=skysql slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS max_slave_connections=1 -connection_keepalive=5 +connection_keepalive=1 [Read Connection Router Slave] type=service diff --git a/maxscale-system-test/mxs827_write_timeout.cpp b/maxscale-system-test/mxs827_write_timeout.cpp index ca6c58000..710632f0c 100644 --- a/maxscale-system-test/mxs827_write_timeout.cpp +++ b/maxscale-system-test/mxs827_write_timeout.cpp @@ -23,14 +23,16 @@ int main(int argc, char* argv[]) create_t1(Test->maxscales->conn_rwsplit[0]); - for (int i = 0; i < 30; i++) + Test->tprintf("Doing reads for 30 seconds"); + time_t start = time(NULL); + + while (time(NULL) - start < 30) { - Test->tprintf("Trying query %d\n", i); Test->set_timeout(10); Test->try_query(Test->maxscales->conn_rwsplit[0], "SELECT 1"); - sleep(1); } + Test->tprintf("Doing one write"); Test->try_query(Test->maxscales->conn_rwsplit[0], "INSERT INTO t1 VALUES (1, 1)"); Test->check_maxscale_alive(0); diff --git a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc index 8d36489ff..497edba56 100644 --- a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc +++ b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc @@ -920,7 +920,7 @@ static int gw_read_and_write(DCB* dcb) if (proto->ignore_replies > 0) { /** The reply to a COM_CHANGE_USER is in packet */ - GWBUF* query = proto->stored_query; + GWBUF* query = modutil_get_next_MySQL_packet(&proto->stored_query); proto->stored_query = NULL; proto->ignore_replies--; mxb_assert(proto->ignore_replies >= 0);