Update current DCB for hangup events

When fake hangup events are delivered via DCBs, the current DCB would not
be updated. This would cause error messages without a session ID which
makes failure analysis harder.
This commit is contained in:
Markus Mäkelä 2019-07-03 12:57:27 +03:00
parent 2d77a361f2
commit f36b6492ab
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -2046,15 +2046,19 @@ static void dcb_hangup_foreach_worker(MXB_WORKER* worker, struct server* server)
{
RoutingWorker* rworker = static_cast<RoutingWorker*>(worker);
int id = rworker->id();
DCB* old_current = this_thread.current_dcb;
for (DCB* dcb = this_unit.all_dcbs[id]; dcb; dcb = dcb->thread.next)
{
if (dcb->state == DCB_STATE_POLLING && dcb->server && dcb->server == server && dcb->n_close == 0)
{
this_thread.current_dcb = dcb;
dcb->flags |= DCBF_HUNG;
dcb->func.hangup(dcb);
}
}
this_thread.current_dcb = old_current;
}
/**