From bf6369899127bc01dc81482dfee41e7e61d4a5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 16 May 2019 10:18:48 +0300 Subject: [PATCH] MXS-2464: Bring back the runtime query queue check The code that checked that only non-empty queries are stored in the query queue was left out when the query queue fix was backported to 2.3. Since MXS-2464 is caused by a still unknown bug, the runtime check should help figure out in which cases the problem occurs. --- server/modules/routing/readwritesplit/rwsplitsession.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/modules/routing/readwritesplit/rwsplitsession.cc b/server/modules/routing/readwritesplit/rwsplitsession.cc index 138144aaf..676e93937 100644 --- a/server/modules/routing/readwritesplit/rwsplitsession.cc +++ b/server/modules/routing/readwritesplit/rwsplitsession.cc @@ -225,6 +225,14 @@ bool RWSplitSession::route_stored_query() auto query = std::move(m_query_queue.front()); m_query_queue.pop_front(); + if (!query.get()) + { + MXS_ALERT("MXS-2464: Query in query queue unexpectedly null. Queue has %lu queries left.", + m_query_queue.size()); + mxb_assert(!true); + continue; + } + /** Store the query queue locally for the duration of the routeQuery call. * This prevents recursive calls into this function. */ decltype(m_query_queue) temp_storage;