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.
This commit is contained in:
Markus Mäkelä 2019-05-16 10:18:48 +03:00
parent 1c820f6ae3
commit bf63698991
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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;