Fix to MXS-500: Statement cloning is now properly handled

If a statement wasn't cloned for the Tee filter, the session would be closed
leading to a possible hang. Instead of closing the session when a statement
isn't cloned, it should not expect a response from that server for that statement.
This commit is contained in:
Markus Makela 2015-12-09 11:53:26 +02:00
parent 231a620dc0
commit a663a8ec5c

View File

@ -1318,6 +1318,15 @@ int route_single_query(TEE_INSTANCE* my_instance, TEE_SESSION* my_session, GWBUF
my_session->active = 0;
return rval;
}
if (clone == NULL)
{
/** We won't be expecting any response from the child branch */
my_session->waiting[CHILD] = false;
my_session->eof[CHILD] = 2;
my_session->n_rejected++;
}
rval = my_session->down.routeQuery(my_session->down.instance,
my_session->down.session,
buffer);
@ -1338,16 +1347,7 @@ int route_single_query(TEE_INSTANCE* my_instance, TEE_SESSION* my_session, GWBUF
gwbuf_free(clone);
}
}
else
{
if (my_session->active)
{
MXS_INFO("Closed tee filter session: Child session is NULL.");
my_session->active = 0;
rval = 0;
}
my_session->n_rejected++;
}
return rval;
}