Add a fail-safe for active operation counters

If a backend is not in use but it is waiting for a result, the state
should anyways be cleared to keep the operation counters correct.
This commit is contained in:
Markus Makela 2016-09-24 10:14:59 +03:00
parent dd65062531
commit 997fe6b90b

View File

@ -958,6 +958,15 @@ static void closeSession(ROUTER *instance, void *router_session)
else
{
ss_dassert(!BREF_IS_WAITING_RESULT(bref));
/** This should never be true unless a backend reference is taken
* out of use before clearing the BREF_WAITING_RESULT state */
if (BREF_IS_WAITING_RESULT(bref))
{
MXS_WARNING("A closed backend was expecting a result, this should not be possible. "
"Decrementing active operation counter for this backend.");
bref_clear_state(bref, BREF_WAITING_RESULT);
}
}
}
/** Unlock */