MXS-2196: Don't loop over persistent connections
When doing a loop over each DCB, don't process DCBs without sessions. For now this is correct behavior as only DCBs in the persistent pool have no session.
This commit is contained in:
@ -2515,12 +2515,19 @@ void dcb_foreach_local(bool (* func)(DCB* dcb, void* data), void* data)
|
|||||||
int thread_id = RoutingWorker::get_current_id();
|
int thread_id = RoutingWorker::get_current_id();
|
||||||
|
|
||||||
for (DCB* dcb = this_unit.all_dcbs[thread_id]; dcb; dcb = dcb->thread.next)
|
for (DCB* dcb = this_unit.all_dcbs[thread_id]; dcb; dcb = dcb->thread.next)
|
||||||
|
{
|
||||||
|
if (dcb->session)
|
||||||
{
|
{
|
||||||
if (!func(dcb, data))
|
if (!func(dcb, data))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mxb_assert_message(dcb->persistentstart > 0, "The DCB must be in a connection pool");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int dcb_get_port(const DCB* dcb)
|
int dcb_get_port(const DCB* dcb)
|
||||||
|
Reference in New Issue
Block a user